{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Python Algorithmic Trading Cookbook"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Chapter 9: Algorithmic Trading: Backtesting"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "This Jupyter Notebook is created using Python version 3.8.2"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "----"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Requirements"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "You can install the requirements for this Jupyter Notebook by executing the below cell"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 0,
   "metadata": {},
   "outputs": [],
   "source": [
    "!pip install pyalgotrading"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "----"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Recipe 1: EMA-Regular-Order Strategy: Fetching the Strategy"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "from pyalgotrading.algobulls import AlgoBullsConnection"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "algobulls_connection = AlgoBullsConnection()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Please login to this URL with your AlgoBulls credentials and get your developer access token: https://app.algobulls.com/user/login\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "'https://app.algobulls.com/user/login'"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "algobulls_connection.get_authorization_url()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "algobulls_connection.set_access_token('80b7a69b168c5b3f15d56688841a8f2da5e2ab2c')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>strategyCode</th>\n",
       "      <th>strategyName</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>49287246f9704bbcbad76ade9e2091d9</td>\n",
       "      <td>EMA Regular Order Strategy</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>4faf514fe096432b8e9f80f5951bd2ea</td>\n",
       "      <td>MACD Bracket Order Strategy</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                       strategyCode                 strategyName\n",
       "0  49287246f9704bbcbad76ade9e2091d9   EMA Regular Order Strategy\n",
       "1  4faf514fe096432b8e9f80f5951bd2ea  MACD Bracket Order Strategy"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "all_strategies = algobulls_connection.get_all_strategies()\n",
    "all_strategies"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'49287246f9704bbcbad76ade9e2091d9'"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "strategy_code1 = all_strategies.iloc[0]['strategyCode']\n",
    "strategy_code1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "class StrategyEMARegularOrder(StrategyBase):\n",
      "\n",
      "    def __init__(self, *args, **kwargs):\n",
      "        super().__init__(*args, **kwargs)\n",
      "\n",
      "        self.timeperiod1 = self.strategy_parameters['timeperiod1']\n",
      "        self.timeperiod2 = self.strategy_parameters['timeperiod2']\n",
      "\n",
      "        self.main_order = None\n",
      "\n",
      "    def initialize(self):\n",
      "        self.main_order = {}\n",
      "\n",
      "    @staticmethod\n",
      "    def name():\n",
      "        return 'EMA Regular Order Strategy'\n",
      "\n",
      "    @staticmethod\n",
      "    def versions_supported():\n",
      "        return AlgoBullsEngineVersion.VERSION_3_2_0\n",
      "\n",
      "    def get_crossover_value(self, instrument):\n",
      "        hist_data = self.get_historical_data(instrument)\n",
      "        ema_x = talib.EMA(hist_data['close'], timeperiod=self.timeperiod1)\n",
      "        ema_y = talib.EMA(hist_data['close'], timeperiod=self.timeperiod2)\n",
      "        crossover_value = self.utils.crossover(ema_x, ema_y)\n",
      "        return crossover_value\n",
      "\n",
      "    def strategy_select_instruments_for_entry(self, candle, instruments_bucket):\n",
      "\n",
      "        selected_instruments_bucket = []\n",
      "        sideband_info_bucket = []\n",
      "\n",
      "        for instrument in instruments_bucket:\n",
      "            crossover_value = self.get_crossover_value(instrument)\n",
      "            if crossover_value == 1:\n",
      "                selected_instruments_bucket.append(instrument)\n",
      "                sideband_info_bucket.append({'action': 'BUY'})\n",
      "            elif crossover_value == -1:\n",
      "                if self.strategy_mode is StrategyMode.INTRADAY:\n",
      "                    selected_instruments_bucket.append(instrument)\n",
      "                    sideband_info_bucket.append({'action': 'SELL'})\n",
      "\n",
      "        return selected_instruments_bucket, sideband_info_bucket\n",
      "\n",
      "    def strategy_enter_position(self, candle, instrument, sideband_info):\n",
      "        if sideband_info['action'] == 'BUY':\n",
      "            qty = self.number_of_lots * instrument.lot_size\n",
      "            self.main_order[instrument] = \\\n",
      "                self.broker.BuyOrderRegular(instrument=instrument,\n",
      "                                            order_code=BrokerOrderCodeConstants.INTRADAY,\n",
      "                                            order_variety=BrokerOrderVarietyConstants.MARKET,\n",
      "                                            quantity=qty)\n",
      "        elif sideband_info['action'] == 'SELL':\n",
      "            qty = self.number_of_lots * instrument.lot_size\n",
      "            self.main_order[instrument] = \\\n",
      "                self.broker.SellOrderRegular(instrument=instrument,\n",
      "                                             order_code=BrokerOrderCodeConstants.INTRADAY,\n",
      "                                             order_variety=BrokerOrderVarietyConstants.MARKET,\n",
      "                                             quantity=qty)\n",
      "        else:\n",
      "            raise SystemExit(f'Got invalid sideband_info value: {sideband_info}')\n",
      "\n",
      "        return self.main_order[instrument]\n",
      "\n",
      "    def strategy_select_instruments_for_exit(self, candle, instruments_bucket):\n",
      "        selected_instruments_bucket = []\n",
      "        sideband_info_bucket = []\n",
      "\n",
      "        for instrument in instruments_bucket:\n",
      "            if self.main_order.get(instrument) is not None:\n",
      "                crossover_value = self.get_crossover_value(instrument)\n",
      "                if crossover_value in [1, -1]:\n",
      "                    selected_instruments_bucket.append(instrument)\n",
      "                    sideband_info_bucket.append({'action': 'EXIT'})\n",
      "        return selected_instruments_bucket, sideband_info_bucket\n",
      "\n",
      "    def strategy_exit_position(self, candle, instrument, sideband_info):\n",
      "        if sideband_info['action'] == 'EXIT':\n",
      "            self.main_order[instrument].exit_position()\n",
      "            self.main_order[instrument] = None\n",
      "            return True\n",
      "\n",
      "        return False\n",
      "\n"
     ]
    }
   ],
   "source": [
    "strategy_details1 = algobulls_connection.get_strategy_details(strategy_code1)\n",
    "print(strategy_details1)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Recipe 2: EMA-Regular-Order Strategy: Backtesting the Strategy"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "from datetime import datetime as dt\n",
    "from pyalgotrading.constants import *"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[{'id': 7, 'value': 'NSE:SBIN'}]"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "instruments = algobulls_connection.search_instrument('SBIN')\n",
    "instruments"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'NSE:SBIN'"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "instrument = instruments[0]['value']\n",
    "instrument"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Setting Strategy Config... Success.\n",
      "Submitting BACKTESTING job... Success.\n"
     ]
    }
   ],
   "source": [
    "algobulls_connection.backtest(strategy_code=strategy_code1, \n",
    "                              start_timestamp=dt(year=2020, month=7, day=1, hour=9, minute=15), \n",
    "                              end_timestamp=dt(year=2020, month=7, day=7, hour=15, minute=30), \n",
    "                              instrument=instrument, \n",
    "                              lots=1,\n",
    "                              strategy_parameters={\n",
    "                                  'timeperiod1': 5,\n",
    "                                  'timeperiod2': 12\n",
    "                              }, \n",
    "                              candle_interval=CandleInterval.MINUTES_15)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'data': 'STARTING'}"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "algobulls_connection.get_backtesting_job_status(strategy_code1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'data': 'STARTED'}"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "algobulls_connection.get_backtesting_job_status(strategy_code1)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### There's more..."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Stopping BACKTESTING job... Success.\n"
     ]
    }
   ],
   "source": [
    "algobulls_connection.stop_backtesting_job(strategy_code1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'data': 'STOPPING'}"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "algobulls_connection.get_backtesting_job_status(strategy_code1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'data': 'STOPPED'}"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "algobulls_connection.get_backtesting_job_status(strategy_code1)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<img src=\"images/diagrams/abc-job-status-state-diagram.png\" width='50%'>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Recipe 3: EMA-Regular-Order Strategy: Fetching Backtesting Logs in Realtime"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[2020-07-30 17:25:18] Logs not available yet. Please retry in sometime.\n"
     ]
    }
   ],
   "source": [
    "logs = algobulls_connection.get_backtesting_logs(strategy_code1)\n",
    "print(logs)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[2020-07-30 11:56:29] Performing sanity checks on cfg strategy_parameters, setting up broker connection and required data structures...\n",
      "[2020-07-30 11:56:29] ABBroker connection has been setup successfully.\n",
      "[2020-07-30 11:56:29] Sanity checks on cfg successful.\n",
      "[2020-07-30 11:56:29] Setting up broker connection...\n",
      "[2020-07-30 11:56:29] Broker connection has been setup successfully.\n",
      "[2020-07-30 11:56:29] (NSE_EQ) Funds available in client's ABVirtualBroker account is : Rs. '1000000000.00'\n",
      "[2020-07-30 11:56:29] \n",
      "########################################\n",
      " INITIALIZING ALGOBULLS CORE (v3.2.0 SECURE MODE)... \n",
      "########################################\n",
      "[2020-07-30 11:56:29] Welcome ALGOBULLS VIRTUAL USER!\n",
      "[2020-07-30 11:56:29] Reading strategy...\n",
      "[2020-07-30 11:56:29] Entering Backtesting mode. Henceforth, all timestamps will be backtesting timestamps...\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] STARTING ALGOBULLS CORE...\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] \n",
      "            \n",
      "  #####  #######    #    ######  ####### ### #     #  #####     \n",
      " #     #    #      # #   #     #    #     #  ##    # #     #    \n",
      " #          #     #   #  #     #    #     #  # #   # #          \n",
      "  #####     #    #     # ######     #     #  #  #  # #  ####    \n",
      "       #    #    ####### #   #      #     #  #   # # #     #    \n",
      " #     #    #    #     # #    #     #     #  #    ## #     #    \n",
      "  #####     #    #     # #     #    #    ### #     #  #####     \n",
      "\n",
      "    #    #        #####  ####### ######  #     # #       #        #####    \n",
      "   # #   #       #     # #     # #     # #     # #       #       #     #   \n",
      "  #   #  #       #       #     # #     # #     # #       #       #         \n",
      " #     # #       #  #### #     # ######  #     # #       #        #####    \n",
      " ####### #       #     # #     # #     # #     # #       #             #   \n",
      " #     # #       #     # #     # #     # #     # #       #       #     #   \n",
      " #     # #######  #####  ####### ######   #####  ####### #######  #####    \n",
      "\n",
      "  #####  ####### ######  #######\n",
      " #     # #     # #     # #\n",
      " #       #     # #     # #\n",
      " #       #     # ######  #####\n",
      " #       #     # #   #   #\n",
      " #     # #     # #    #  #\n",
      "  #####  ####### #     # #######\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] --------------------Master Cfg Parameters:--------------------\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] User: ALGOBULLS VIRTUAL USER\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] Broker: ABVIRTUALBROKER\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] AUTO_ADD_INSTRUMENTS_BUCKET_FROM_POSITIONS: False\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] AUTO_ADD_INSTRUMENTS_BUCKET_FROM_HOLDINGS_TPLUS1: False\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] AUTO_ADD_INSTRUMENTS_BUCKET_FROM_HOLDINGS_TPLUS2: False\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] RESUME_POSITIONS_ON_START: True\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] RESUME_HOLDINGS_TPLUS1_ON_START: True\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] RESUME_HOLDINGS_TPLUS2_ON_START: True\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] EXIT_INTRADAY_ORDERS_ON_STOP: False\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] EXIT_TPLUS1_DELIVERY_ORDERS_ON_STOP: False\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] EXIT_TPLUS2_DELIVERY_ORDERS_ON_STOP: False\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] --------------------User Cfg Parameters: System Parameters--------------------\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] Trading type: BACKTESTING\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] User trading start time: 2020-07-01 09:15:00\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] User trading end time: 2020-07-07 15:30:00\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] --------------------User Cfg Parameters: Funds Parameters--------------------\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] Credit Exposure: 1\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] Fund Allocator: FundAllocatorLots\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] Fund Allocator Parameters: {'NUMBER_OF_LOTS': 1}\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] --------------------User Cfg Parameters: Candle Parameters--------------------\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] Candle interval (sec): 900\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] --------------------User Cfg Parameters: Strategy Parameters--------------------\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] Strategy: EMA Regular Order Strategy\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] Parameters: {'timeperiod1': 5, 'timeperiod2': 12}\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] Strategy Mode: INTRADAY\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] Instruments Bucket: instruments_bucket | [NSE_EQ:SBIN]\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] --------------------User Cfg Parameters: Risk Management Parameters--------------------\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] Target Trigger: 0.1000\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] Stoploss Trigger: 0.1000\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] Trailing Stoploss Trigger: 0.1000\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] Desired profit: 20000.0\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] Risk Appetite: 10000.0\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] PNL scan frequency (in sec): 30\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] --------------------User Cfg Parameters: Other Parameters--------------------\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] Allow multiple orders for same script: True\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] Allow new order when order for script already running: True\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] Instrument max orders count: 100\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] Remove Instrument if Order Rejected: False\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] ------------------------------------------------------------\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [utils] Instrument (NSE_EQ:SBIN) subscribed to historical data successfully\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [utils] 1 Instrument(s) (re)subscribed to historical data successfully\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [utils] Prefetching historical data for 1 instruments...\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [strategy] \n",
      "####################\n",
      "Strategy Parameters:\n",
      "{'timeperiod1': 5, 'timeperiod2': 12}\n",
      "####################\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [utils] 1 Instrument(s) (re)subscribed to historical data successfully\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] Opening current intraday positions, if any...\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] Not processing holdings as STRATEGY_MODE is INTRADAY\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-01 09:30:00)...\n",
      "[BT] [2020-07-01 09:30:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-01 09:45:00)...\n",
      "[BT] [2020-07-01 09:45:00] [INFO] [tls] Entering position for instrument: NSE_EQ:SBIN...\n",
      "[BT] [2020-07-01 09:45:00] [CRITICAL] [order] [PLACING NEW ORDER] [2020-07-01 09:45:00] [2333198611b744aeb287300d371c8eb5] [BUY] [NSE:SBIN] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 180.25] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_ENTER]\n",
      "[BT] [2020-07-01 09:45:00] [INFO] [positions] Created new Position: Position: [BUY] [NSE:SBIN] [QTY:1] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY]\n",
      "[BT] [2020-07-01 09:45:00] [INFO] [order] [ORDER ID RECEIVED] [ABVirtualBroker] [ID:2333198611b744aeb287300d371c8eb5] [BUY] [NSE_EQ:SBIN] [Order ID: (Order: [2020-07-01 09:45:00] [2333198611b744aeb287300d371c8eb5] [BUY] [NSE:SBIN] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 180.25] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_ENTER])\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> COMPLETE)]\n",
      "[BT] [2020-07-01 09:45:00] [INFO] [order] [NEW ORDER SUCCESS] [2020-07-01 09:45:00] [2333198611b744aeb287300d371c8eb5] [BUY] [NSE:SBIN] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 180.25] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_ENTER] [STATUS:COMPLETE]\n",
      "[BT] [2020-07-01 09:45:00] [INFO] [tls] Instrument entered position: NSE_EQ:SBIN. Order placed\n",
      "[BT] [2020-07-01 09:45:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-01 10:00:00)...\n",
      "[BT] [2020-07-01 10:00:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-01 10:15:00)...\n",
      "[BT] [2020-07-01 10:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-01 10:30:00)...\n",
      "[BT] [2020-07-01 10:30:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-01 10:45:00)...\n",
      "[BT] [2020-07-01 10:45:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-01 11:00:00)...\n",
      "[BT] [2020-07-01 11:00:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-01 11:15:00)...\n",
      "[BT] [2020-07-01 11:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-01 11:30:00)...\n",
      "[BT] [2020-07-01 11:30:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-01 11:45:00)...\n",
      "[BT] [2020-07-01 11:45:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-01 12:00:00)...\n",
      "[BT] [2020-07-01 12:00:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-01 12:15:00)...\n",
      "[BT] [2020-07-01 12:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-01 12:30:00)...\n",
      "[BT] [2020-07-01 12:30:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-01 12:45:00)...\n",
      "[BT] [2020-07-01 12:45:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-01 13:00:00)...\n",
      "[BT] [2020-07-01 13:00:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-01 13:15:00)...\n",
      "[BT] [2020-07-01 13:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-01 13:30:00)...\n",
      "[BT] [2020-07-01 13:30:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-01 13:45:00)...\n",
      "[BT] [2020-07-01 13:45:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-01 14:00:00)...\n",
      "[BT] [2020-07-01 14:00:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-01 14:15:00)...\n",
      "[BT] [2020-07-01 14:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-01 14:30:00)...\n",
      "[BT] [2020-07-01 14:30:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-01 14:45:00)...\n",
      "[BT] [2020-07-01 14:45:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-01 15:00:00)...\n",
      "[BT] [2020-07-01 15:00:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-01 15:15:00)...\n",
      "[BT] [2020-07-01 15:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-01 15:30:00)...\n",
      "[BT] [2020-07-01 15:30:00] [INFO] [oms] Exiting OPEN POSITION (Order: [2020-07-01 09:45:00] [2333198611b744aeb287300d371c8eb5] [BUY] [NSE:SBIN] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 180.25] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_ENTER])...\n",
      "[BT] [2020-07-01 15:30:00] [CRITICAL] [order] [PLACING NEW ORDER] [2020-07-01 15:30:00] [67f39f41885b476295e7e959b0470d49] [SELL] [NSE:SBIN] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 184.45] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_EXIT]\n",
      "[BT] [2020-07-01 15:30:00] [INFO] [order] [ORDER ID RECEIVED] [ABVirtualBroker] [ID:67f39f41885b476295e7e959b0470d49] [SELL] [NSE_EQ:SBIN] [Order ID: (Order: [2020-07-01 15:30:00] [67f39f41885b476295e7e959b0470d49] [SELL] [NSE:SBIN] [QTY:1] [QTY PENDING: 0] [ENTRY PRICE: 184.45] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_EXIT])\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> COMPLETE)]\n",
      "[BT] [2020-07-01 15:30:00] [INFO] [order] [NEW ORDER SUCCESS] [2020-07-01 15:30:00] [67f39f41885b476295e7e959b0470d49] [SELL] [NSE:SBIN] [QTY:1] [QTY PENDING: 0] [ENTRY PRICE: 184.45] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_EXIT] [STATUS:COMPLETE]\n",
      "[BT] [2020-07-02 09:15:00] [INFO] [utils] 1 Instrument(s) (re)subscribed to historical data successfully\n",
      "[BT] [2020-07-02 09:15:00] [INFO] [tls] Opening current intraday positions, if any...\n",
      "[BT] [2020-07-02 09:15:00] [INFO] [tls] Not processing holdings as STRATEGY_MODE is INTRADAY\n",
      "[BT] [2020-07-02 09:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-02 09:30:00)...\n",
      "[BT] [2020-07-02 09:30:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-02 09:45:00)...\n",
      "[BT] [2020-07-02 09:45:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-02 10:00:00)...\n",
      "[BT] [2020-07-02 10:00:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-02 10:15:00)...\n",
      "[BT] [2020-07-02 10:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-02 10:30:00)...\n",
      "[BT] [2020-07-02 10:30:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-02 10:45:00)...\n",
      "[BT] [2020-07-02 10:45:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-02 11:00:00)...\n",
      "[BT] [2020-07-02 11:00:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-02 11:15:00)...\n",
      "[BT] [2020-07-02 11:15:00] [INFO] [tls] Entering position for instrument: NSE_EQ:SBIN...\n",
      "[BT] [2020-07-02 11:15:00] [CRITICAL] [order] [PLACING NEW ORDER] [2020-07-02 11:15:00] [76a0c500fd92458e9afcaf0c02bcda4c] [SELL] [NSE:SBIN] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 184.4] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_ENTER]\n",
      "[BT] [2020-07-02 11:15:00] [INFO] [positions] Created new Position: Position: [SELL] [NSE:SBIN] [QTY:-1] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY]\n",
      "[BT] [2020-07-02 11:15:00] [INFO] [order] [ORDER ID RECEIVED] [ABVirtualBroker] [ID:76a0c500fd92458e9afcaf0c02bcda4c] [SELL] [NSE_EQ:SBIN] [Order ID: (Order: [2020-07-02 11:15:00] [76a0c500fd92458e9afcaf0c02bcda4c] [SELL] [NSE:SBIN] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 184.4] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_ENTER])\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> COMPLETE)]\n",
      "[BT] [2020-07-02 11:15:00] [INFO] [order] [NEW ORDER SUCCESS] [2020-07-02 11:15:00] [76a0c500fd92458e9afcaf0c02bcda4c] [SELL] [NSE:SBIN] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 184.4] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_ENTER] [STATUS:COMPLETE]\n",
      "[BT] [2020-07-02 11:15:00] [INFO] [tls] Instrument entered position: NSE_EQ:SBIN. Order placed\n",
      "[BT] [2020-07-02 11:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-02 11:30:00)...\n",
      "[BT] [2020-07-02 11:30:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-02 11:45:00)...\n",
      "[BT] [2020-07-02 11:45:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-02 12:00:00)...\n",
      "[BT] [2020-07-02 12:00:00] [CRITICAL] [order] [PLACING NEW ORDER] [2020-07-02 12:00:00] [adeb184d3397495a9367f1e7f7297bd6] [BUY] [NSE:SBIN] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 185.55] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_EXIT]\n",
      "[BT] [2020-07-02 12:00:00] [INFO] [order] [ORDER ID RECEIVED] [ABVirtualBroker] [ID:adeb184d3397495a9367f1e7f7297bd6] [BUY] [NSE_EQ:SBIN] [Order ID: (Order: [2020-07-02 12:00:00] [adeb184d3397495a9367f1e7f7297bd6] [BUY] [NSE:SBIN] [QTY:1] [QTY PENDING: 0] [ENTRY PRICE: 185.55] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_EXIT])\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> COMPLETE)]\n",
      "[BT] [2020-07-02 12:00:00] [INFO] [order] [NEW ORDER SUCCESS] [2020-07-02 12:00:00] [adeb184d3397495a9367f1e7f7297bd6] [BUY] [NSE:SBIN] [QTY:1] [QTY PENDING: 0] [ENTRY PRICE: 185.55] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_EXIT] [STATUS:COMPLETE]\n",
      "[BT] [2020-07-02 12:00:00] [INFO] [tls] Entering position for instrument: NSE_EQ:SBIN...\n",
      "[BT] [2020-07-02 12:00:00] [CRITICAL] [order] [PLACING NEW ORDER] [2020-07-02 12:00:00] [aaf5a5984c804b32954155412cd0720d] [BUY] [NSE:SBIN] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 185.55] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_ENTER]\n",
      "[BT] [2020-07-02 12:00:00] [INFO] [positions] Created new Position: Position: [BUY] [NSE:SBIN] [QTY:1] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY]\n",
      "[BT] [2020-07-02 12:00:00] [INFO] [order] [ORDER ID RECEIVED] [ABVirtualBroker] [ID:aaf5a5984c804b32954155412cd0720d] [BUY] [NSE_EQ:SBIN] [Order ID: (Order: [2020-07-02 12:00:00] [aaf5a5984c804b32954155412cd0720d] [BUY] [NSE:SBIN] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 185.55] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_ENTER])\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> COMPLETE)]\n",
      "[BT] [2020-07-02 12:00:00] [INFO] [order] [NEW ORDER SUCCESS] [2020-07-02 12:00:00] [aaf5a5984c804b32954155412cd0720d] [BUY] [NSE:SBIN] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 185.55] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_ENTER] [STATUS:COMPLETE]\n",
      "[BT] [2020-07-02 12:00:00] [INFO] [tls] Instrument entered position: NSE_EQ:SBIN. Order placed\n",
      "[BT] [2020-07-02 12:00:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-02 12:15:00)...\n",
      "[BT] [2020-07-02 12:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-02 12:30:00)...\n",
      "[BT] [2020-07-02 12:30:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-02 12:45:00)...\n",
      "[BT] [2020-07-02 12:45:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-02 13:00:00)...\n",
      "[BT] [2020-07-02 13:00:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-02 13:15:00)...\n",
      "[BT] [2020-07-02 13:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-02 13:30:00)...\n",
      "[BT] [2020-07-02 13:30:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-02 13:45:00)...\n",
      "[BT] [2020-07-02 13:45:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-02 14:00:00)...\n",
      "[BT] [2020-07-02 14:00:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-02 14:15:00)...\n",
      "[BT] [2020-07-02 14:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-02 14:30:00)...\n",
      "[BT] [2020-07-02 14:30:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-02 14:45:00)...\n",
      "[BT] [2020-07-02 14:45:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-02 15:00:00)...\n",
      "[BT] [2020-07-02 15:00:00] [CRITICAL] [order] [PLACING NEW ORDER] [2020-07-02 15:00:00] [948a5f73e9c24d20b20b84d8a2345ab7] [SELL] [NSE:SBIN] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 185.6] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_EXIT]\n",
      "[BT] [2020-07-02 15:00:00] [INFO] [order] [ORDER ID RECEIVED] [ABVirtualBroker] [ID:948a5f73e9c24d20b20b84d8a2345ab7] [SELL] [NSE_EQ:SBIN] [Order ID: (Order: [2020-07-02 15:00:00] [948a5f73e9c24d20b20b84d8a2345ab7] [SELL] [NSE:SBIN] [QTY:1] [QTY PENDING: 0] [ENTRY PRICE: 185.6] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_EXIT])\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> COMPLETE)]\n",
      "[BT] [2020-07-02 15:00:00] [INFO] [order] [NEW ORDER SUCCESS] [2020-07-02 15:00:00] [948a5f73e9c24d20b20b84d8a2345ab7] [SELL] [NSE:SBIN] [QTY:1] [QTY PENDING: 0] [ENTRY PRICE: 185.6] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_EXIT] [STATUS:COMPLETE]\n",
      "[BT] [2020-07-02 15:00:00] [INFO] [tls] Entering position for instrument: NSE_EQ:SBIN...\n",
      "[BT] [2020-07-02 15:00:00] [CRITICAL] [order] [PLACING NEW ORDER] [2020-07-02 15:00:00] [3e59ba37ad8742b5bf13906d85ba5db3] [SELL] [NSE:SBIN] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 185.6] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_ENTER]\n",
      "[BT] [2020-07-02 15:00:00] [INFO] [positions] Created new Position: Position: [SELL] [NSE:SBIN] [QTY:-1] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY]\n",
      "[BT] [2020-07-02 15:00:00] [INFO] [order] [ORDER ID RECEIVED] [ABVirtualBroker] [ID:3e59ba37ad8742b5bf13906d85ba5db3] [SELL] [NSE_EQ:SBIN] [Order ID: (Order: [2020-07-02 15:00:00] [3e59ba37ad8742b5bf13906d85ba5db3] [SELL] [NSE:SBIN] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 185.6] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_ENTER])\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> COMPLETE)]\n",
      "[BT] [2020-07-02 15:00:00] [INFO] [order] [NEW ORDER SUCCESS] [2020-07-02 15:00:00] [3e59ba37ad8742b5bf13906d85ba5db3] [SELL] [NSE:SBIN] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 185.6] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_ENTER] [STATUS:COMPLETE]\n",
      "[BT] [2020-07-02 15:00:00] [INFO] [tls] Instrument entered position: NSE_EQ:SBIN. Order placed\n",
      "[BT] [2020-07-02 15:00:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-02 15:15:00)...\n",
      "[BT] [2020-07-02 15:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-02 15:30:00)...\n",
      "[BT] [2020-07-02 15:30:00] [INFO] [oms] Exiting OPEN POSITION (Order: [2020-07-02 15:00:00] [3e59ba37ad8742b5bf13906d85ba5db3] [SELL] [NSE:SBIN] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 185.6] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_ENTER])...\n",
      "[BT] [2020-07-02 15:30:00] [CRITICAL] [order] [PLACING NEW ORDER] [2020-07-02 15:30:00] [f242542057704476a56e920e396bb3ee] [BUY] [NSE:SBIN] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 185.7] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_EXIT]\n",
      "[BT] [2020-07-02 15:30:00] [INFO] [order] [ORDER ID RECEIVED] [ABVirtualBroker] [ID:f242542057704476a56e920e396bb3ee] [BUY] [NSE_EQ:SBIN] [Order ID: (Order: [2020-07-02 15:30:00] [f242542057704476a56e920e396bb3ee] [BUY] [NSE:SBIN] [QTY:1] [QTY PENDING: 0] [ENTRY PRICE: 185.7] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_EXIT])\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> COMPLETE)]\n",
      "[BT] [2020-07-02 15:30:00] [INFO] [order] [NEW ORDER SUCCESS] [2020-07-02 15:30:00] [f242542057704476a56e920e396bb3ee] [BUY] [NSE:SBIN] [QTY:1] [QTY PENDING: 0] [ENTRY PRICE: 185.7] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_EXIT] [STATUS:COMPLETE]\n",
      "[BT] [2020-07-03 09:15:00] [INFO] [utils] 1 Instrument(s) (re)subscribed to historical data successfully\n",
      "[BT] [2020-07-03 09:15:00] [INFO] [tls] Opening current intraday positions, if any...\n",
      "[BT] [2020-07-03 09:15:00] [INFO] [tls] Not processing holdings as STRATEGY_MODE is INTRADAY\n",
      "[BT] [2020-07-03 09:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-03 09:30:00)...\n",
      "[BT] [2020-07-03 09:30:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-03 09:45:00)...\n",
      "[BT] [2020-07-03 09:45:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-03 10:00:00)...\n",
      "[BT] [2020-07-03 10:00:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-03 10:15:00)...\n",
      "[BT] [2020-07-03 10:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-03 10:30:00)...\n",
      "[BT] [2020-07-03 10:30:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-03 10:45:00)...\n",
      "[BT] [2020-07-03 10:45:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-03 11:00:00)...\n",
      "[BT] [2020-07-03 11:00:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-03 11:15:00)...\n",
      "[BT] [2020-07-03 11:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-03 11:30:00)...\n",
      "[BT] [2020-07-03 11:30:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-03 11:45:00)...\n",
      "[BT] [2020-07-03 11:45:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-03 12:00:00)...\n",
      "[BT] [2020-07-03 12:00:00] [INFO] [tls] Entering position for instrument: NSE_EQ:SBIN...\n",
      "[BT] [2020-07-03 12:00:00] [CRITICAL] [order] [PLACING NEW ORDER] [2020-07-03 12:00:00] [61a87ff8dff245d7bfb37e14f8ccf94e] [BUY] [NSE:SBIN] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 185.45] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_ENTER]\n",
      "[BT] [2020-07-03 12:00:00] [INFO] [positions] Created new Position: Position: [BUY] [NSE:SBIN] [QTY:1] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY]\n",
      "[BT] [2020-07-03 12:00:00] [INFO] [order] [ORDER ID RECEIVED] [ABVirtualBroker] [ID:61a87ff8dff245d7bfb37e14f8ccf94e] [BUY] [NSE_EQ:SBIN] [Order ID: (Order: [2020-07-03 12:00:00] [61a87ff8dff245d7bfb37e14f8ccf94e] [BUY] [NSE:SBIN] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 185.45] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_ENTER])\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> COMPLETE)]\n",
      "[BT] [2020-07-03 12:00:00] [INFO] [order] [NEW ORDER SUCCESS] [2020-07-03 12:00:00] [61a87ff8dff245d7bfb37e14f8ccf94e] [BUY] [NSE:SBIN] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 185.45] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_ENTER] [STATUS:COMPLETE]\n",
      "[BT] [2020-07-03 12:00:00] [INFO] [tls] Instrument entered position: NSE_EQ:SBIN. Order placed\n",
      "[BT] [2020-07-03 12:00:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-03 12:15:00)...\n",
      "[BT] [2020-07-03 12:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-03 12:30:00)...\n",
      "[BT] [2020-07-03 12:30:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-03 12:45:00)...\n",
      "[BT] [2020-07-03 12:45:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-03 13:00:00)...\n",
      "[BT] [2020-07-03 13:00:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-03 13:15:00)...\n",
      "[BT] [2020-07-03 13:15:00] [CRITICAL] [order] [PLACING NEW ORDER] [2020-07-03 13:15:00] [7ac291b30a624f0b803d4538719f82dc] [SELL] [NSE:SBIN] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 184.6] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_EXIT]\n",
      "[BT] [2020-07-03 13:15:00] [INFO] [order] [ORDER ID RECEIVED] [ABVirtualBroker] [ID:7ac291b30a624f0b803d4538719f82dc] [SELL] [NSE_EQ:SBIN] [Order ID: (Order: [2020-07-03 13:15:00] [7ac291b30a624f0b803d4538719f82dc] [SELL] [NSE:SBIN] [QTY:1] [QTY PENDING: 0] [ENTRY PRICE: 184.6] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_EXIT])\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> COMPLETE)]\n",
      "[BT] [2020-07-03 13:15:00] [INFO] [order] [NEW ORDER SUCCESS] [2020-07-03 13:15:00] [7ac291b30a624f0b803d4538719f82dc] [SELL] [NSE:SBIN] [QTY:1] [QTY PENDING: 0] [ENTRY PRICE: 184.6] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_EXIT] [STATUS:COMPLETE]\n",
      "[BT] [2020-07-03 13:15:00] [INFO] [tls] Entering position for instrument: NSE_EQ:SBIN...\n",
      "[BT] [2020-07-03 13:15:00] [CRITICAL] [order] [PLACING NEW ORDER] [2020-07-03 13:15:00] [f528840f3de8411688ef75d284c49e7d] [SELL] [NSE:SBIN] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 184.6] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_ENTER]\n",
      "[BT] [2020-07-03 13:15:00] [INFO] [positions] Created new Position: Position: [SELL] [NSE:SBIN] [QTY:-1] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY]\n",
      "[BT] [2020-07-03 13:15:00] [INFO] [order] [ORDER ID RECEIVED] [ABVirtualBroker] [ID:f528840f3de8411688ef75d284c49e7d] [SELL] [NSE_EQ:SBIN] [Order ID: (Order: [2020-07-03 13:15:00] [f528840f3de8411688ef75d284c49e7d] [SELL] [NSE:SBIN] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 184.6] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_ENTER])\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> COMPLETE)]\n",
      "[BT] [2020-07-03 13:15:00] [INFO] [order] [NEW ORDER SUCCESS] [2020-07-03 13:15:00] [f528840f3de8411688ef75d284c49e7d] [SELL] [NSE:SBIN] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 184.6] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_ENTER] [STATUS:COMPLETE]\n",
      "[BT] [2020-07-03 13:15:00] [INFO] [tls] Instrument entered position: NSE_EQ:SBIN. Order placed\n",
      "[BT] [2020-07-03 13:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-03 13:30:00)...\n",
      "[BT] [2020-07-03 13:30:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-03 13:45:00)...\n",
      "[BT] [2020-07-03 13:45:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-03 14:00:00)...\n",
      "[BT] [2020-07-03 14:00:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-03 14:15:00)...\n",
      "[BT] [2020-07-03 14:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-03 14:30:00)...\n",
      "[BT] [2020-07-03 14:30:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-03 14:45:00)...\n",
      "[BT] [2020-07-03 14:45:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-03 15:00:00)...\n",
      "[BT] [2020-07-03 15:00:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-03 15:15:00)...\n",
      "[BT] [2020-07-03 15:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-03 15:30:00)...\n",
      "[BT] [2020-07-03 15:30:00] [INFO] [oms] Exiting OPEN POSITION (Order: [2020-07-03 13:15:00] [f528840f3de8411688ef75d284c49e7d] [SELL] [NSE:SBIN] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 184.6] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_ENTER])...\n",
      "[BT] [2020-07-03 15:30:00] [CRITICAL] [order] [PLACING NEW ORDER] [2020-07-03 15:30:00] [db7507899ec845af8d5319ebae717606] [BUY] [NSE:SBIN] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 184.6] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_EXIT]\n",
      "[BT] [2020-07-03 15:30:00] [INFO] [order] [ORDER ID RECEIVED] [ABVirtualBroker] [ID:db7507899ec845af8d5319ebae717606] [BUY] [NSE_EQ:SBIN] [Order ID: (Order: [2020-07-03 15:30:00] [db7507899ec845af8d5319ebae717606] [BUY] [NSE:SBIN] [QTY:1] [QTY PENDING: 0] [ENTRY PRICE: 184.6] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_EXIT])\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> COMPLETE)]\n",
      "[BT] [2020-07-03 15:30:00] [INFO] [order] [NEW ORDER SUCCESS] [2020-07-03 15:30:00] [db7507899ec845af8d5319ebae717606] [BUY] [NSE:SBIN] [QTY:1] [QTY PENDING: 0] [ENTRY PRICE: 184.6] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_EXIT] [STATUS:COMPLETE]\n",
      "[BT] [2020-07-06 09:15:00] [INFO] [utils] 1 Instrument(s) (re)subscribed to historical data successfully\n",
      "[BT] [2020-07-06 09:15:00] [INFO] [tls] Opening current intraday positions, if any...\n",
      "[BT] [2020-07-06 09:15:00] [INFO] [tls] Not processing holdings as STRATEGY_MODE is INTRADAY\n",
      "[BT] [2020-07-06 09:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-06 09:30:00)...\n",
      "[BT] [2020-07-06 09:30:00] [INFO] [tls] Entering position for instrument: NSE_EQ:SBIN...\n",
      "[BT] [2020-07-06 09:30:00] [CRITICAL] [order] [PLACING NEW ORDER] [2020-07-06 09:30:00] [08ab1127cc5941c7a314e6375d46e4dc] [BUY] [NSE:SBIN] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 187.65] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_ENTER]\n",
      "[BT] [2020-07-06 09:30:00] [INFO] [positions] Created new Position: Position: [BUY] [NSE:SBIN] [QTY:1] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY]\n",
      "[BT] [2020-07-06 09:30:00] [INFO] [order] [ORDER ID RECEIVED] [ABVirtualBroker] [ID:08ab1127cc5941c7a314e6375d46e4dc] [BUY] [NSE_EQ:SBIN] [Order ID: (Order: [2020-07-06 09:30:00] [08ab1127cc5941c7a314e6375d46e4dc] [BUY] [NSE:SBIN] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 187.65] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_ENTER])\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> COMPLETE)]\n",
      "[BT] [2020-07-06 09:30:00] [INFO] [order] [NEW ORDER SUCCESS] [2020-07-06 09:30:00] [08ab1127cc5941c7a314e6375d46e4dc] [BUY] [NSE:SBIN] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 187.65] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_ENTER] [STATUS:COMPLETE]\n",
      "[BT] [2020-07-06 09:30:00] [INFO] [tls] Instrument entered position: NSE_EQ:SBIN. Order placed\n",
      "[BT] [2020-07-06 09:30:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-06 09:45:00)...\n",
      "[BT] [2020-07-06 09:45:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-06 10:00:00)...\n",
      "[BT] [2020-07-06 10:00:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-06 10:15:00)...\n",
      "[BT] [2020-07-06 10:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-06 10:30:00)...\n",
      "[BT] [2020-07-06 10:30:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-06 10:45:00)...\n",
      "[BT] [2020-07-06 10:45:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-06 11:00:00)...\n",
      "[BT] [2020-07-06 11:00:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-06 11:15:00)...\n",
      "[BT] [2020-07-06 11:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-06 11:30:00)...\n",
      "[BT] [2020-07-06 11:30:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-06 11:45:00)...\n",
      "[BT] [2020-07-06 11:45:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-06 12:00:00)...\n",
      "[BT] [2020-07-06 12:00:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-06 12:15:00)...\n",
      "[BT] [2020-07-06 12:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-06 12:30:00)...\n",
      "[BT] [2020-07-06 12:30:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-06 12:45:00)...\n",
      "[BT] [2020-07-06 12:45:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-06 13:00:00)...\n",
      "[BT] [2020-07-06 13:00:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-06 13:15:00)...\n",
      "[BT] [2020-07-06 13:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-06 13:30:00)...\n",
      "[BT] [2020-07-06 13:30:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-06 13:45:00)...\n",
      "[BT] [2020-07-06 13:45:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-06 14:00:00)...\n",
      "[BT] [2020-07-06 14:00:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-06 14:15:00)...\n",
      "[BT] [2020-07-06 14:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-06 14:30:00)...\n",
      "[BT] [2020-07-06 14:30:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-06 14:45:00)...\n",
      "[BT] [2020-07-06 14:45:00] [CRITICAL] [order] [PLACING NEW ORDER] [2020-07-06 14:45:00] [628ada697cbc4bfcb343a2e3e2ecad99] [SELL] [NSE:SBIN] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 187.85] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_EXIT]\n",
      "[BT] [2020-07-06 14:45:00] [INFO] [order] [ORDER ID RECEIVED] [ABVirtualBroker] [ID:628ada697cbc4bfcb343a2e3e2ecad99] [SELL] [NSE_EQ:SBIN] [Order ID: (Order: [2020-07-06 14:45:00] [628ada697cbc4bfcb343a2e3e2ecad99] [SELL] [NSE:SBIN] [QTY:1] [QTY PENDING: 0] [ENTRY PRICE: 187.85] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_EXIT])\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> COMPLETE)]\n",
      "[BT] [2020-07-06 14:45:00] [INFO] [order] [NEW ORDER SUCCESS] [2020-07-06 14:45:00] [628ada697cbc4bfcb343a2e3e2ecad99] [SELL] [NSE:SBIN] [QTY:1] [QTY PENDING: 0] [ENTRY PRICE: 187.85] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_EXIT] [STATUS:COMPLETE]\n",
      "[BT] [2020-07-06 14:45:00] [INFO] [tls] Entering position for instrument: NSE_EQ:SBIN...\n",
      "[BT] [2020-07-06 14:45:00] [CRITICAL] [order] [PLACING NEW ORDER] [2020-07-06 14:45:00] [8a6a323c14af43399b11975137d79efc] [SELL] [NSE:SBIN] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 187.85] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_ENTER]\n",
      "[BT] [2020-07-06 14:45:00] [INFO] [positions] Created new Position: Position: [SELL] [NSE:SBIN] [QTY:-1] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY]\n",
      "[BT] [2020-07-06 14:45:00] [INFO] [order] [ORDER ID RECEIVED] [ABVirtualBroker] [ID:8a6a323c14af43399b11975137d79efc] [SELL] [NSE_EQ:SBIN] [Order ID: (Order: [2020-07-06 14:45:00] [8a6a323c14af43399b11975137d79efc] [SELL] [NSE:SBIN] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 187.85] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_ENTER])\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> COMPLETE)]\n",
      "[BT] [2020-07-06 14:45:00] [INFO] [order] [NEW ORDER SUCCESS] [2020-07-06 14:45:00] [8a6a323c14af43399b11975137d79efc] [SELL] [NSE:SBIN] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 187.85] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_ENTER] [STATUS:COMPLETE]\n",
      "[BT] [2020-07-06 14:45:00] [INFO] [tls] Instrument entered position: NSE_EQ:SBIN. Order placed\n",
      "[BT] [2020-07-06 14:45:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-06 15:00:00)...\n",
      "[BT] [2020-07-06 15:00:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-06 15:15:00)...\n",
      "[BT] [2020-07-06 15:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-06 15:30:00)...\n",
      "[BT] [2020-07-06 15:30:00] [INFO] [oms] Exiting OPEN POSITION (Order: [2020-07-06 14:45:00] [8a6a323c14af43399b11975137d79efc] [SELL] [NSE:SBIN] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 187.85] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_ENTER])...\n",
      "[BT] [2020-07-06 15:30:00] [CRITICAL] [order] [PLACING NEW ORDER] [2020-07-06 15:30:00] [0e0e842584c042dfb9b217ff525f484a] [BUY] [NSE:SBIN] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 187.9] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_EXIT]\n",
      "[BT] [2020-07-06 15:30:00] [INFO] [order] [ORDER ID RECEIVED] [ABVirtualBroker] [ID:0e0e842584c042dfb9b217ff525f484a] [BUY] [NSE_EQ:SBIN] [Order ID: (Order: [2020-07-06 15:30:00] [0e0e842584c042dfb9b217ff525f484a] [BUY] [NSE:SBIN] [QTY:1] [QTY PENDING: 0] [ENTRY PRICE: 187.9] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_EXIT])\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> COMPLETE)]\n",
      "[BT] [2020-07-06 15:30:00] [INFO] [order] [NEW ORDER SUCCESS] [2020-07-06 15:30:00] [0e0e842584c042dfb9b217ff525f484a] [BUY] [NSE:SBIN] [QTY:1] [QTY PENDING: 0] [ENTRY PRICE: 187.9] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_EXIT] [STATUS:COMPLETE]\n",
      "[BT] [2020-07-07 09:15:00] [INFO] [utils] 1 Instrument(s) (re)subscribed to historical data successfully\n",
      "[BT] [2020-07-07 09:15:00] [INFO] [tls] Opening current intraday positions, if any...\n",
      "[BT] [2020-07-07 09:15:00] [INFO] [tls] Not processing holdings as STRATEGY_MODE is INTRADAY\n",
      "[BT] [2020-07-07 09:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-07 09:30:00)...\n",
      "[BT] [2020-07-07 09:30:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-07 09:45:00)...\n",
      "[BT] [2020-07-07 09:45:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-07 10:00:00)...\n",
      "[BT] [2020-07-07 10:00:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-07 10:15:00)...\n",
      "[BT] [2020-07-07 10:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-07 10:30:00)...\n",
      "[BT] [2020-07-07 10:30:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-07 10:45:00)...\n",
      "[BT] [2020-07-07 10:45:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-07 11:00:00)...\n",
      "[BT] [2020-07-07 11:00:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-07 11:15:00)...\n",
      "[BT] [2020-07-07 11:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-07 11:30:00)...\n",
      "[BT] [2020-07-07 11:30:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-07 11:45:00)...\n",
      "[BT] [2020-07-07 11:45:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-07 12:00:00)...\n",
      "[BT] [2020-07-07 12:00:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-07 12:15:00)...\n",
      "[BT] [2020-07-07 12:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-07 12:30:00)...\n",
      "[BT] [2020-07-07 12:30:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-07 12:45:00)...\n",
      "[BT] [2020-07-07 12:45:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-07 13:00:00)...\n",
      "[BT] [2020-07-07 13:00:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-07 13:15:00)...\n",
      "[BT] [2020-07-07 13:15:00] [INFO] [tls] Entering position for instrument: NSE_EQ:SBIN...\n",
      "[BT] [2020-07-07 13:15:00] [CRITICAL] [order] [PLACING NEW ORDER] [2020-07-07 13:15:00] [26e3026c13444a9a906bcd540457c53e] [BUY] [NSE:SBIN] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 186.55] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_ENTER]\n",
      "[BT] [2020-07-07 13:15:00] [INFO] [positions] Created new Position: Position: [BUY] [NSE:SBIN] [QTY:1] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY]\n",
      "[BT] [2020-07-07 13:15:00] [INFO] [order] [ORDER ID RECEIVED] [ABVirtualBroker] [ID:26e3026c13444a9a906bcd540457c53e] [BUY] [NSE_EQ:SBIN] [Order ID: (Order: [2020-07-07 13:15:00] [26e3026c13444a9a906bcd540457c53e] [BUY] [NSE:SBIN] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 186.55] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_ENTER])\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> COMPLETE)]\n",
      "[BT] [2020-07-07 13:15:00] [INFO] [order] [NEW ORDER SUCCESS] [2020-07-07 13:15:00] [26e3026c13444a9a906bcd540457c53e] [BUY] [NSE:SBIN] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 186.55] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_ENTER] [STATUS:COMPLETE]\n",
      "[BT] [2020-07-07 13:15:00] [INFO] [tls] Instrument entered position: NSE_EQ:SBIN. Order placed\n",
      "[BT] [2020-07-07 13:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-07 13:30:00)...\n",
      "[BT] [2020-07-07 13:30:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-07 13:45:00)...\n",
      "[BT] [2020-07-07 13:45:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-07 14:00:00)...\n",
      "[BT] [2020-07-07 14:00:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-07 14:15:00)...\n",
      "[BT] [2020-07-07 14:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-07 14:30:00)...\n",
      "[BT] [2020-07-07 14:30:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-07 14:45:00)...\n",
      "[BT] [2020-07-07 14:45:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-07 15:00:00)...\n",
      "[BT] [2020-07-07 15:00:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-07 15:15:00)...\n",
      "[BT] [2020-07-07 15:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-07 15:30:00)...\n",
      "[BT] [2020-07-07 15:30:00] [INFO] [oms] Exiting OPEN POSITION (Order: [2020-07-07 13:15:00] [26e3026c13444a9a906bcd540457c53e] [BUY] [NSE:SBIN] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 186.55] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_ENTER])...\n",
      "[BT] [2020-07-07 15:30:00] [CRITICAL] [order] [PLACING NEW ORDER] [2020-07-07 15:30:00] [527e82d96ffd4fdd96809576785dbeb7] [SELL] [NSE:SBIN] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 188.0] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_EXIT]\n",
      "[BT] [2020-07-07 15:30:00] [INFO] [order] [ORDER ID RECEIVED] [ABVirtualBroker] [ID:527e82d96ffd4fdd96809576785dbeb7] [SELL] [NSE_EQ:SBIN] [Order ID: (Order: [2020-07-07 15:30:00] [527e82d96ffd4fdd96809576785dbeb7] [SELL] [NSE:SBIN] [QTY:1] [QTY PENDING: 0] [ENTRY PRICE: 188.0] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_EXIT])\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> COMPLETE)]\n",
      "[BT] [2020-07-07 15:30:00] [INFO] [order] [NEW ORDER SUCCESS] [2020-07-07 15:30:00] [527e82d96ffd4fdd96809576785dbeb7] [SELL] [NSE:SBIN] [QTY:1] [QTY PENDING: 0] [ENTRY PRICE: 188.0] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_EXIT] [STATUS:COMPLETE]\n",
      "[BT] [2020-07-07 15:30:00] [INFO] [clock] Candle generation has been stopped...\n",
      "[BT] [2020-07-07 15:30:00] [INFO] [tls] Received event END OF MARKET. Stopping Trading Core Engine...\n",
      "[BT] [2020-07-07 15:30:00] [CRITICAL] [tls] [User: ALGOBULLS VIRTUAL USER] Trading session completed\n",
      "[BT] [2020-07-07 15:30:00] [INFO] [oms] \n",
      "\n",
      "PENDING ORDERS:\n",
      "\n",
      "\n",
      "COMPLETED ORDERS:\n",
      "[2020-07-01 09:45:00] [2333198611b744aeb287300d371c8eb5] [BUY] [NSE:SBIN] [QTY:1] [QTY PENDING: 0] [ENTRY PRICE: 180.25] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_ENTER]\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> COMPLETE\n",
      "\n",
      "[2020-07-01 15:30:00] [67f39f41885b476295e7e959b0470d49] [SELL] [NSE:SBIN] [QTY:1] [QTY PENDING: 0] [ENTRY PRICE: 184.45] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_EXIT]\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> COMPLETE\n",
      "\n",
      "[2020-07-02 11:15:00] [76a0c500fd92458e9afcaf0c02bcda4c] [SELL] [NSE:SBIN] [QTY:1] [QTY PENDING: 0] [ENTRY PRICE: 184.4] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_ENTER]\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> COMPLETE\n",
      "\n",
      "[2020-07-02 12:00:00] [adeb184d3397495a9367f1e7f7297bd6] [BUY] [NSE:SBIN] [QTY:1] [QTY PENDING: 0] [ENTRY PRICE: 185.55] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_EXIT]\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> COMPLETE\n",
      "\n",
      "[2020-07-02 12:00:00] [aaf5a5984c804b32954155412cd0720d] [BUY] [NSE:SBIN] [QTY:1] [QTY PENDING: 0] [ENTRY PRICE: 185.55] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_ENTER]\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> COMPLETE\n",
      "\n",
      "[2020-07-02 15:00:00] [948a5f73e9c24d20b20b84d8a2345ab7] [SELL] [NSE:SBIN] [QTY:1] [QTY PENDING: 0] [ENTRY PRICE: 185.6] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_EXIT]\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> COMPLETE\n",
      "\n",
      "[2020-07-02 15:00:00] [3e59ba37ad8742b5bf13906d85ba5db3] [SELL] [NSE:SBIN] [QTY:1] [QTY PENDING: 0] [ENTRY PRICE: 185.6] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_ENTER]\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> COMPLETE\n",
      "\n",
      "[2020-07-02 15:30:00] [f242542057704476a56e920e396bb3ee] [BUY] [NSE:SBIN] [QTY:1] [QTY PENDING: 0] [ENTRY PRICE: 185.7] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_EXIT]\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> COMPLETE\n",
      "\n",
      "[2020-07-03 12:00:00] [61a87ff8dff245d7bfb37e14f8ccf94e] [BUY] [NSE:SBIN] [QTY:1] [QTY PENDING: 0] [ENTRY PRICE: 185.45] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_ENTER]\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> COMPLETE\n",
      "\n",
      "[2020-07-03 13:15:00] [7ac291b30a624f0b803d4538719f82dc] [SELL] [NSE:SBIN] [QTY:1] [QTY PENDING: 0] [ENTRY PRICE: 184.6] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_EXIT]\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> COMPLETE\n",
      "\n",
      "[2020-07-03 13:15:00] [f528840f3de8411688ef75d284c49e7d] [SELL] [NSE:SBIN] [QTY:1] [QTY PENDING: 0] [ENTRY PRICE: 184.6] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_ENTER]\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> COMPLETE\n",
      "\n",
      "[2020-07-03 15:30:00] [db7507899ec845af8d5319ebae717606] [BUY] [NSE:SBIN] [QTY:1] [QTY PENDING: 0] [ENTRY PRICE: 184.6] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_EXIT]\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> COMPLETE\n",
      "\n",
      "[2020-07-06 09:30:00] [08ab1127cc5941c7a314e6375d46e4dc] [BUY] [NSE:SBIN] [QTY:1] [QTY PENDING: 0] [ENTRY PRICE: 187.65] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_ENTER]\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> COMPLETE\n",
      "\n",
      "[2020-07-06 14:45:00] [628ada697cbc4bfcb343a2e3e2ecad99] [SELL] [NSE:SBIN] [QTY:1] [QTY PENDING: 0] [ENTRY PRICE: 187.85] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_EXIT]\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> COMPLETE\n",
      "\n",
      "[2020-07-06 14:45:00] [8a6a323c14af43399b11975137d79efc] [SELL] [NSE:SBIN] [QTY:1] [QTY PENDING: 0] [ENTRY PRICE: 187.85] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_ENTER]\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> COMPLETE\n",
      "\n",
      "[2020-07-06 15:30:00] [0e0e842584c042dfb9b217ff525f484a] [BUY] [NSE:SBIN] [QTY:1] [QTY PENDING: 0] [ENTRY PRICE: 187.9] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_EXIT]\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> COMPLETE\n",
      "\n",
      "[2020-07-07 13:15:00] [26e3026c13444a9a906bcd540457c53e] [BUY] [NSE:SBIN] [QTY:1] [QTY PENDING: 0] [ENTRY PRICE: 186.55] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_ENTER]\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> COMPLETE\n",
      "\n",
      "[2020-07-07 15:30:00] [527e82d96ffd4fdd96809576785dbeb7] [SELL] [NSE:SBIN] [QTY:1] [QTY PENDING: 0] [ENTRY PRICE: 188.0] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_EXIT]\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> COMPLETE\n",
      "\n",
      "\n",
      "POSITIONS:\n",
      "\n",
      "\n",
      "HOLDINGS:\n",
      "\n"
     ]
    }
   ],
   "source": [
    "logs = algobulls_connection.get_backtesting_logs(strategy_code1)\n",
    "print(logs)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Recipe 4: EMA-Regular-Order Strategy: Fetching Backtesting Reports - Profit-n-Loss Table"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>instrument</th>\n",
       "      <th>entry_timestamp</th>\n",
       "      <th>entry_transaction_type</th>\n",
       "      <th>entry_quantity</th>\n",
       "      <th>entry_price</th>\n",
       "      <th>exit_timestamp</th>\n",
       "      <th>exit_transaction_type</th>\n",
       "      <th>exit_quantity</th>\n",
       "      <th>exit_price</th>\n",
       "      <th>pnl_absolute</th>\n",
       "      <th>pnl_percentage</th>\n",
       "      <th>pnl_cumulative_absolute</th>\n",
       "      <th>pnl_cumulative_percentage</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>NSE_EQ:SBIN</td>\n",
       "      <td>2020-07-07 13:15:00</td>\n",
       "      <td>BUY</td>\n",
       "      <td>1</td>\n",
       "      <td>186.55</td>\n",
       "      <td>2020-07-07 15:30:00</td>\n",
       "      <td>SELL</td>\n",
       "      <td>1</td>\n",
       "      <td>188.0</td>\n",
       "      <td>1.45</td>\n",
       "      <td>0.78</td>\n",
       "      <td>3.75</td>\n",
       "      <td>2.09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>NSE_EQ:SBIN</td>\n",
       "      <td>2020-07-06 14:45:00</td>\n",
       "      <td>SELL</td>\n",
       "      <td>1</td>\n",
       "      <td>187.85</td>\n",
       "      <td>2020-07-06 15:30:00</td>\n",
       "      <td>BUY</td>\n",
       "      <td>1</td>\n",
       "      <td>187.9</td>\n",
       "      <td>-0.05</td>\n",
       "      <td>-0.03</td>\n",
       "      <td>2.3</td>\n",
       "      <td>1.31</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>NSE_EQ:SBIN</td>\n",
       "      <td>2020-07-06 09:30:00</td>\n",
       "      <td>BUY</td>\n",
       "      <td>1</td>\n",
       "      <td>187.65</td>\n",
       "      <td>2020-07-06 14:45:00</td>\n",
       "      <td>SELL</td>\n",
       "      <td>1</td>\n",
       "      <td>187.85</td>\n",
       "      <td>0.2</td>\n",
       "      <td>0.11</td>\n",
       "      <td>2.35</td>\n",
       "      <td>1.34</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>NSE_EQ:SBIN</td>\n",
       "      <td>2020-07-03 13:15:00</td>\n",
       "      <td>SELL</td>\n",
       "      <td>1</td>\n",
       "      <td>184.6</td>\n",
       "      <td>2020-07-03 15:30:00</td>\n",
       "      <td>BUY</td>\n",
       "      <td>1</td>\n",
       "      <td>184.6</td>\n",
       "      <td>-0.0</td>\n",
       "      <td>-0.0</td>\n",
       "      <td>2.15</td>\n",
       "      <td>1.23</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>NSE_EQ:SBIN</td>\n",
       "      <td>2020-07-03 12:00:00</td>\n",
       "      <td>BUY</td>\n",
       "      <td>1</td>\n",
       "      <td>185.45</td>\n",
       "      <td>2020-07-03 13:15:00</td>\n",
       "      <td>SELL</td>\n",
       "      <td>1</td>\n",
       "      <td>184.6</td>\n",
       "      <td>-0.85</td>\n",
       "      <td>-0.46</td>\n",
       "      <td>2.15</td>\n",
       "      <td>1.23</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>NSE_EQ:SBIN</td>\n",
       "      <td>2020-07-02 15:00:00</td>\n",
       "      <td>SELL</td>\n",
       "      <td>1</td>\n",
       "      <td>185.6</td>\n",
       "      <td>2020-07-02 15:30:00</td>\n",
       "      <td>BUY</td>\n",
       "      <td>1</td>\n",
       "      <td>185.7</td>\n",
       "      <td>-0.1</td>\n",
       "      <td>-0.05</td>\n",
       "      <td>3.0</td>\n",
       "      <td>1.69</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>NSE_EQ:SBIN</td>\n",
       "      <td>2020-07-02 12:00:00</td>\n",
       "      <td>BUY</td>\n",
       "      <td>1</td>\n",
       "      <td>185.55</td>\n",
       "      <td>2020-07-02 15:00:00</td>\n",
       "      <td>SELL</td>\n",
       "      <td>1</td>\n",
       "      <td>185.6</td>\n",
       "      <td>0.05</td>\n",
       "      <td>0.03</td>\n",
       "      <td>3.1</td>\n",
       "      <td>1.74</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>NSE_EQ:SBIN</td>\n",
       "      <td>2020-07-02 11:15:00</td>\n",
       "      <td>SELL</td>\n",
       "      <td>1</td>\n",
       "      <td>184.4</td>\n",
       "      <td>2020-07-02 12:00:00</td>\n",
       "      <td>BUY</td>\n",
       "      <td>1</td>\n",
       "      <td>185.55</td>\n",
       "      <td>-1.15</td>\n",
       "      <td>-0.62</td>\n",
       "      <td>3.05</td>\n",
       "      <td>1.71</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>NSE_EQ:SBIN</td>\n",
       "      <td>2020-07-01 09:45:00</td>\n",
       "      <td>BUY</td>\n",
       "      <td>1</td>\n",
       "      <td>180.25</td>\n",
       "      <td>2020-07-01 15:30:00</td>\n",
       "      <td>SELL</td>\n",
       "      <td>1</td>\n",
       "      <td>184.45</td>\n",
       "      <td>4.2</td>\n",
       "      <td>2.33</td>\n",
       "      <td>4.2</td>\n",
       "      <td>2.33</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    instrument      entry_timestamp entry_transaction_type entry_quantity  \\\n",
       "0  NSE_EQ:SBIN  2020-07-07 13:15:00                    BUY              1   \n",
       "1  NSE_EQ:SBIN  2020-07-06 14:45:00                   SELL              1   \n",
       "2  NSE_EQ:SBIN  2020-07-06 09:30:00                    BUY              1   \n",
       "3  NSE_EQ:SBIN  2020-07-03 13:15:00                   SELL              1   \n",
       "4  NSE_EQ:SBIN  2020-07-03 12:00:00                    BUY              1   \n",
       "5  NSE_EQ:SBIN  2020-07-02 15:00:00                   SELL              1   \n",
       "6  NSE_EQ:SBIN  2020-07-02 12:00:00                    BUY              1   \n",
       "7  NSE_EQ:SBIN  2020-07-02 11:15:00                   SELL              1   \n",
       "8  NSE_EQ:SBIN  2020-07-01 09:45:00                    BUY              1   \n",
       "\n",
       "  entry_price       exit_timestamp exit_transaction_type exit_quantity  \\\n",
       "0      186.55  2020-07-07 15:30:00                  SELL             1   \n",
       "1      187.85  2020-07-06 15:30:00                   BUY             1   \n",
       "2      187.65  2020-07-06 14:45:00                  SELL             1   \n",
       "3       184.6  2020-07-03 15:30:00                   BUY             1   \n",
       "4      185.45  2020-07-03 13:15:00                  SELL             1   \n",
       "5       185.6  2020-07-02 15:30:00                   BUY             1   \n",
       "6      185.55  2020-07-02 15:00:00                  SELL             1   \n",
       "7       184.4  2020-07-02 12:00:00                   BUY             1   \n",
       "8      180.25  2020-07-01 15:30:00                  SELL             1   \n",
       "\n",
       "  exit_price pnl_absolute pnl_percentage pnl_cumulative_absolute  \\\n",
       "0      188.0         1.45           0.78                    3.75   \n",
       "1      187.9        -0.05          -0.03                     2.3   \n",
       "2     187.85          0.2           0.11                    2.35   \n",
       "3      184.6         -0.0           -0.0                    2.15   \n",
       "4      184.6        -0.85          -0.46                    2.15   \n",
       "5      185.7         -0.1          -0.05                     3.0   \n",
       "6      185.6         0.05           0.03                     3.1   \n",
       "7     185.55        -1.15          -0.62                    3.05   \n",
       "8     184.45          4.2           2.33                     4.2   \n",
       "\n",
       "  pnl_cumulative_percentage  \n",
       "0                      2.09  \n",
       "1                      1.31  \n",
       "2                      1.34  \n",
       "3                      1.23  \n",
       "4                      1.23  \n",
       "5                      1.69  \n",
       "6                      1.74  \n",
       "7                      1.71  \n",
       "8                      2.33  "
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "algobulls_connection.get_backtesting_report_pnl_table(strategy_code1, show_all_rows=True)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Recipe 5: EMA-Regular-Order Strategy: Fetching Backtesting Reports - Statistics Table"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>highlight_type</th>\n",
       "      <th>highlight_value</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Net PnL</td>\n",
       "      <td>3.75</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Net PnL %</td>\n",
       "      <td>2.09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Max Drawdown</td>\n",
       "      <td>2.15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Max Drawdown %</td>\n",
       "      <td>1.16</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Number of Trades</td>\n",
       "      <td>9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>Number of Wins</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>Number of Looses</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>Number of Long Trades</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>Number of Short Trades</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>Max Gain</td>\n",
       "      <td>4.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>Min Gain</td>\n",
       "      <td>-1.15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>Avg. Profit per winning trade</td>\n",
       "      <td>1.48</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>Avg. Profit per losing trade</td>\n",
       "      <td>-0.54</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                   highlight_type highlight_value\n",
       "0                         Net PnL            3.75\n",
       "1                       Net PnL %            2.09\n",
       "2                    Max Drawdown            2.15\n",
       "3                  Max Drawdown %            1.16\n",
       "4                Number of Trades               9\n",
       "5                  Number of Wins               5\n",
       "6                Number of Looses               4\n",
       "7           Number of Long Trades               5\n",
       "8          Number of Short Trades               4\n",
       "9                        Max Gain             4.2\n",
       "10                       Min Gain           -1.15\n",
       "11  Avg. Profit per winning trade            1.48\n",
       "12   Avg. Profit per losing trade           -0.54"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "algobulls_connection.get_backtesting_report_statistics(strategy_code1)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Recipe 6: EMA-Regular-Order Strategy: Fetching Backtesting Reports - Order History"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\n",
      "+-------------+---------------------+----------------------------------+------+\n",
      "| INST        | TIME                | ID                               | TT   |\n",
      "|-------------+---------------------+----------------------------------+------|\n",
      "| NSE_EQ:SBIN | 2020-07-01 09:45:00 | 2333198611b744aeb287300d371c8eb5 | BUY  |\n",
      "+-------------+---------------------+----------------------------------+------+\n",
      "+----+---------------------+------------------------+-------+\n",
      "|    | TIME                | STATE                  | MSG   |\n",
      "|----+---------------------+------------------------+-------|\n",
      "|  0 | 2020-07-01 09:45:00 | PUT ORDER REQ RECEIVED |       |\n",
      "|  1 | 2020-07-01 09:45:00 | VALIDATION PENDING     |       |\n",
      "|  2 | 2020-07-01 09:45:00 | OPEN PENDING           |       |\n",
      "|  3 | 2020-07-01 09:45:00 | OPEN                   |       |\n",
      "|  4 | 2020-07-01 09:45:00 | COMPLETE               |       |\n",
      "+----+---------------------+------------------------+-------+\n",
      "\n",
      "+-------------+---------------------+----------------------------------+------+\n",
      "| INST        | TIME                | ID                               | TT   |\n",
      "|-------------+---------------------+----------------------------------+------|\n",
      "| NSE_EQ:SBIN | 2020-07-01 15:30:00 | 67f39f41885b476295e7e959b0470d49 | SELL |\n",
      "+-------------+---------------------+----------------------------------+------+\n",
      "+----+---------------------+------------------------+-------+\n",
      "|    | TIME                | STATE                  | MSG   |\n",
      "|----+---------------------+------------------------+-------|\n",
      "|  0 | 2020-07-01 15:30:00 | PUT ORDER REQ RECEIVED |       |\n",
      "|  1 | 2020-07-01 15:30:00 | VALIDATION PENDING     |       |\n",
      "|  2 | 2020-07-01 15:30:00 | OPEN PENDING           |       |\n",
      "|  3 | 2020-07-01 15:30:00 | OPEN                   |       |\n",
      "|  4 | 2020-07-01 15:30:00 | COMPLETE               |       |\n",
      "+----+---------------------+------------------------+-------+\n",
      "\n",
      "+-------------+---------------------+----------------------------------+------+\n",
      "| INST        | TIME                | ID                               | TT   |\n",
      "|-------------+---------------------+----------------------------------+------|\n",
      "| NSE_EQ:SBIN | 2020-07-02 11:15:00 | 76a0c500fd92458e9afcaf0c02bcda4c | SELL |\n",
      "+-------------+---------------------+----------------------------------+------+\n",
      "+----+---------------------+------------------------+-------+\n",
      "|    | TIME                | STATE                  | MSG   |\n",
      "|----+---------------------+------------------------+-------|\n",
      "|  0 | 2020-07-02 11:15:00 | PUT ORDER REQ RECEIVED |       |\n",
      "|  1 | 2020-07-02 11:15:00 | VALIDATION PENDING     |       |\n",
      "|  2 | 2020-07-02 11:15:00 | OPEN PENDING           |       |\n",
      "|  3 | 2020-07-02 11:15:00 | OPEN                   |       |\n",
      "|  4 | 2020-07-02 11:15:00 | COMPLETE               |       |\n",
      "+----+---------------------+------------------------+-------+\n",
      "\n",
      "+-------------+---------------------+----------------------------------+------+\n",
      "| INST        | TIME                | ID                               | TT   |\n",
      "|-------------+---------------------+----------------------------------+------|\n",
      "| NSE_EQ:SBIN | 2020-07-02 12:00:00 | adeb184d3397495a9367f1e7f7297bd6 | BUY  |\n",
      "+-------------+---------------------+----------------------------------+------+\n",
      "+----+---------------------+------------------------+-------+\n",
      "|    | TIME                | STATE                  | MSG   |\n",
      "|----+---------------------+------------------------+-------|\n",
      "|  0 | 2020-07-02 12:00:00 | PUT ORDER REQ RECEIVED |       |\n",
      "|  1 | 2020-07-02 12:00:00 | VALIDATION PENDING     |       |\n",
      "|  2 | 2020-07-02 12:00:00 | OPEN PENDING           |       |\n",
      "|  3 | 2020-07-02 12:00:00 | OPEN                   |       |\n",
      "|  4 | 2020-07-02 12:00:00 | COMPLETE               |       |\n",
      "+----+---------------------+------------------------+-------+\n",
      "\n",
      "+-------------+---------------------+----------------------------------+------+\n",
      "| INST        | TIME                | ID                               | TT   |\n",
      "|-------------+---------------------+----------------------------------+------|\n",
      "| NSE_EQ:SBIN | 2020-07-02 12:00:00 | aaf5a5984c804b32954155412cd0720d | BUY  |\n",
      "+-------------+---------------------+----------------------------------+------+\n",
      "+----+---------------------+------------------------+-------+\n",
      "|    | TIME                | STATE                  | MSG   |\n",
      "|----+---------------------+------------------------+-------|\n",
      "|  0 | 2020-07-02 12:00:00 | PUT ORDER REQ RECEIVED |       |\n",
      "|  1 | 2020-07-02 12:00:00 | VALIDATION PENDING     |       |\n",
      "|  2 | 2020-07-02 12:00:00 | OPEN PENDING           |       |\n",
      "|  3 | 2020-07-02 12:00:00 | OPEN                   |       |\n",
      "|  4 | 2020-07-02 12:00:00 | COMPLETE               |       |\n",
      "+----+---------------------+------------------------+-------+\n",
      "\n",
      "+-------------+---------------------+----------------------------------+------+\n",
      "| INST        | TIME                | ID                               | TT   |\n",
      "|-------------+---------------------+----------------------------------+------|\n",
      "| NSE_EQ:SBIN | 2020-07-02 15:00:00 | 948a5f73e9c24d20b20b84d8a2345ab7 | SELL |\n",
      "+-------------+---------------------+----------------------------------+------+\n",
      "+----+---------------------+------------------------+-------+\n",
      "|    | TIME                | STATE                  | MSG   |\n",
      "|----+---------------------+------------------------+-------|\n",
      "|  0 | 2020-07-02 15:00:00 | PUT ORDER REQ RECEIVED |       |\n",
      "|  1 | 2020-07-02 15:00:00 | VALIDATION PENDING     |       |\n",
      "|  2 | 2020-07-02 15:00:00 | OPEN PENDING           |       |\n",
      "|  3 | 2020-07-02 15:00:00 | OPEN                   |       |\n",
      "|  4 | 2020-07-02 15:00:00 | COMPLETE               |       |\n",
      "+----+---------------------+------------------------+-------+\n",
      "\n",
      "+-------------+---------------------+----------------------------------+------+\n",
      "| INST        | TIME                | ID                               | TT   |\n",
      "|-------------+---------------------+----------------------------------+------|\n",
      "| NSE_EQ:SBIN | 2020-07-02 15:00:00 | 3e59ba37ad8742b5bf13906d85ba5db3 | SELL |\n",
      "+-------------+---------------------+----------------------------------+------+\n",
      "+----+---------------------+------------------------+-------+\n",
      "|    | TIME                | STATE                  | MSG   |\n",
      "|----+---------------------+------------------------+-------|\n",
      "|  0 | 2020-07-02 15:00:00 | PUT ORDER REQ RECEIVED |       |\n",
      "|  1 | 2020-07-02 15:00:00 | VALIDATION PENDING     |       |\n",
      "|  2 | 2020-07-02 15:00:00 | OPEN PENDING           |       |\n",
      "|  3 | 2020-07-02 15:00:00 | OPEN                   |       |\n",
      "|  4 | 2020-07-02 15:00:00 | COMPLETE               |       |\n",
      "+----+---------------------+------------------------+-------+\n",
      "\n",
      "+-------------+---------------------+----------------------------------+------+\n",
      "| INST        | TIME                | ID                               | TT   |\n",
      "|-------------+---------------------+----------------------------------+------|\n",
      "| NSE_EQ:SBIN | 2020-07-02 15:30:00 | f242542057704476a56e920e396bb3ee | BUY  |\n",
      "+-------------+---------------------+----------------------------------+------+\n",
      "+----+---------------------+------------------------+-------+\n",
      "|    | TIME                | STATE                  | MSG   |\n",
      "|----+---------------------+------------------------+-------|\n",
      "|  0 | 2020-07-02 15:30:00 | PUT ORDER REQ RECEIVED |       |\n",
      "|  1 | 2020-07-02 15:30:00 | VALIDATION PENDING     |       |\n",
      "|  2 | 2020-07-02 15:30:00 | OPEN PENDING           |       |\n",
      "|  3 | 2020-07-02 15:30:00 | OPEN                   |       |\n",
      "|  4 | 2020-07-02 15:30:00 | COMPLETE               |       |\n",
      "+----+---------------------+------------------------+-------+\n",
      "\n",
      "+-------------+---------------------+----------------------------------+------+\n",
      "| INST        | TIME                | ID                               | TT   |\n",
      "|-------------+---------------------+----------------------------------+------|\n",
      "| NSE_EQ:SBIN | 2020-07-03 12:00:00 | 61a87ff8dff245d7bfb37e14f8ccf94e | BUY  |\n",
      "+-------------+---------------------+----------------------------------+------+\n",
      "+----+---------------------+------------------------+-------+\n",
      "|    | TIME                | STATE                  | MSG   |\n",
      "|----+---------------------+------------------------+-------|\n",
      "|  0 | 2020-07-03 12:00:00 | PUT ORDER REQ RECEIVED |       |\n",
      "|  1 | 2020-07-03 12:00:00 | VALIDATION PENDING     |       |\n",
      "|  2 | 2020-07-03 12:00:00 | OPEN PENDING           |       |\n",
      "|  3 | 2020-07-03 12:00:00 | OPEN                   |       |\n",
      "|  4 | 2020-07-03 12:00:00 | COMPLETE               |       |\n",
      "+----+---------------------+------------------------+-------+\n",
      "\n",
      "+-------------+---------------------+----------------------------------+------+\n",
      "| INST        | TIME                | ID                               | TT   |\n",
      "|-------------+---------------------+----------------------------------+------|\n",
      "| NSE_EQ:SBIN | 2020-07-03 13:15:00 | 7ac291b30a624f0b803d4538719f82dc | SELL |\n",
      "+-------------+---------------------+----------------------------------+------+\n",
      "+----+---------------------+------------------------+-------+\n",
      "|    | TIME                | STATE                  | MSG   |\n",
      "|----+---------------------+------------------------+-------|\n",
      "|  0 | 2020-07-03 13:15:00 | PUT ORDER REQ RECEIVED |       |\n",
      "|  1 | 2020-07-03 13:15:00 | VALIDATION PENDING     |       |\n",
      "|  2 | 2020-07-03 13:15:00 | OPEN PENDING           |       |\n",
      "|  3 | 2020-07-03 13:15:00 | OPEN                   |       |\n",
      "|  4 | 2020-07-03 13:15:00 | COMPLETE               |       |\n",
      "+----+---------------------+------------------------+-------+\n",
      "\n",
      "+-------------+---------------------+----------------------------------+------+\n",
      "| INST        | TIME                | ID                               | TT   |\n",
      "|-------------+---------------------+----------------------------------+------|\n",
      "| NSE_EQ:SBIN | 2020-07-03 13:15:00 | f528840f3de8411688ef75d284c49e7d | SELL |\n",
      "+-------------+---------------------+----------------------------------+------+\n",
      "+----+---------------------+------------------------+-------+\n",
      "|    | TIME                | STATE                  | MSG   |\n",
      "|----+---------------------+------------------------+-------|\n",
      "|  0 | 2020-07-03 13:15:00 | PUT ORDER REQ RECEIVED |       |\n",
      "|  1 | 2020-07-03 13:15:00 | VALIDATION PENDING     |       |\n",
      "|  2 | 2020-07-03 13:15:00 | OPEN PENDING           |       |\n",
      "|  3 | 2020-07-03 13:15:00 | OPEN                   |       |\n",
      "|  4 | 2020-07-03 13:15:00 | COMPLETE               |       |\n",
      "+----+---------------------+------------------------+-------+\n",
      "\n",
      "+-------------+---------------------+----------------------------------+------+\n",
      "| INST        | TIME                | ID                               | TT   |\n",
      "|-------------+---------------------+----------------------------------+------|\n",
      "| NSE_EQ:SBIN | 2020-07-03 15:30:00 | db7507899ec845af8d5319ebae717606 | BUY  |\n",
      "+-------------+---------------------+----------------------------------+------+\n",
      "+----+---------------------+------------------------+-------+\n",
      "|    | TIME                | STATE                  | MSG   |\n",
      "|----+---------------------+------------------------+-------|\n",
      "|  0 | 2020-07-03 15:30:00 | PUT ORDER REQ RECEIVED |       |\n",
      "|  1 | 2020-07-03 15:30:00 | VALIDATION PENDING     |       |\n",
      "|  2 | 2020-07-03 15:30:00 | OPEN PENDING           |       |\n",
      "|  3 | 2020-07-03 15:30:00 | OPEN                   |       |\n",
      "|  4 | 2020-07-03 15:30:00 | COMPLETE               |       |\n",
      "+----+---------------------+------------------------+-------+\n",
      "\n",
      "+-------------+---------------------+----------------------------------+------+\n",
      "| INST        | TIME                | ID                               | TT   |\n",
      "|-------------+---------------------+----------------------------------+------|\n",
      "| NSE_EQ:SBIN | 2020-07-06 09:30:00 | 08ab1127cc5941c7a314e6375d46e4dc | BUY  |\n",
      "+-------------+---------------------+----------------------------------+------+\n",
      "+----+---------------------+------------------------+-------+\n",
      "|    | TIME                | STATE                  | MSG   |\n",
      "|----+---------------------+------------------------+-------|\n",
      "|  0 | 2020-07-06 09:30:00 | PUT ORDER REQ RECEIVED |       |\n",
      "|  1 | 2020-07-06 09:30:00 | VALIDATION PENDING     |       |\n",
      "|  2 | 2020-07-06 09:30:00 | OPEN PENDING           |       |\n",
      "|  3 | 2020-07-06 09:30:00 | OPEN                   |       |\n",
      "|  4 | 2020-07-06 09:30:00 | COMPLETE               |       |\n",
      "+----+---------------------+------------------------+-------+\n",
      "\n",
      "+-------------+---------------------+----------------------------------+------+\n",
      "| INST        | TIME                | ID                               | TT   |\n",
      "|-------------+---------------------+----------------------------------+------|\n",
      "| NSE_EQ:SBIN | 2020-07-06 14:45:00 | 628ada697cbc4bfcb343a2e3e2ecad99 | SELL |\n",
      "+-------------+---------------------+----------------------------------+------+\n",
      "+----+---------------------+------------------------+-------+\n",
      "|    | TIME                | STATE                  | MSG   |\n",
      "|----+---------------------+------------------------+-------|\n",
      "|  0 | 2020-07-06 14:45:00 | PUT ORDER REQ RECEIVED |       |\n",
      "|  1 | 2020-07-06 14:45:00 | VALIDATION PENDING     |       |\n",
      "|  2 | 2020-07-06 14:45:00 | OPEN PENDING           |       |\n",
      "|  3 | 2020-07-06 14:45:00 | OPEN                   |       |\n",
      "|  4 | 2020-07-06 14:45:00 | COMPLETE               |       |\n",
      "+----+---------------------+------------------------+-------+\n",
      "\n",
      "+-------------+---------------------+----------------------------------+------+\n",
      "| INST        | TIME                | ID                               | TT   |\n",
      "|-------------+---------------------+----------------------------------+------|\n",
      "| NSE_EQ:SBIN | 2020-07-06 14:45:00 | 8a6a323c14af43399b11975137d79efc | SELL |\n",
      "+-------------+---------------------+----------------------------------+------+\n",
      "+----+---------------------+------------------------+-------+\n",
      "|    | TIME                | STATE                  | MSG   |\n",
      "|----+---------------------+------------------------+-------|\n",
      "|  0 | 2020-07-06 14:45:00 | PUT ORDER REQ RECEIVED |       |\n",
      "|  1 | 2020-07-06 14:45:00 | VALIDATION PENDING     |       |\n",
      "|  2 | 2020-07-06 14:45:00 | OPEN PENDING           |       |\n",
      "|  3 | 2020-07-06 14:45:00 | OPEN                   |       |\n",
      "|  4 | 2020-07-06 14:45:00 | COMPLETE               |       |\n",
      "+----+---------------------+------------------------+-------+\n",
      "\n",
      "+-------------+---------------------+----------------------------------+------+\n",
      "| INST        | TIME                | ID                               | TT   |\n",
      "|-------------+---------------------+----------------------------------+------|\n",
      "| NSE_EQ:SBIN | 2020-07-06 15:30:00 | 0e0e842584c042dfb9b217ff525f484a | BUY  |\n",
      "+-------------+---------------------+----------------------------------+------+\n",
      "+----+---------------------+------------------------+-------+\n",
      "|    | TIME                | STATE                  | MSG   |\n",
      "|----+---------------------+------------------------+-------|\n",
      "|  0 | 2020-07-06 15:30:00 | PUT ORDER REQ RECEIVED |       |\n",
      "|  1 | 2020-07-06 15:30:00 | VALIDATION PENDING     |       |\n",
      "|  2 | 2020-07-06 15:30:00 | OPEN PENDING           |       |\n",
      "|  3 | 2020-07-06 15:30:00 | OPEN                   |       |\n",
      "|  4 | 2020-07-06 15:30:00 | COMPLETE               |       |\n",
      "+----+---------------------+------------------------+-------+\n",
      "\n",
      "+-------------+---------------------+----------------------------------+------+\n",
      "| INST        | TIME                | ID                               | TT   |\n",
      "|-------------+---------------------+----------------------------------+------|\n",
      "| NSE_EQ:SBIN | 2020-07-07 13:15:00 | 26e3026c13444a9a906bcd540457c53e | BUY  |\n",
      "+-------------+---------------------+----------------------------------+------+\n",
      "+----+---------------------+------------------------+-------+\n",
      "|    | TIME                | STATE                  | MSG   |\n",
      "|----+---------------------+------------------------+-------|\n",
      "|  0 | 2020-07-07 13:15:00 | PUT ORDER REQ RECEIVED |       |\n",
      "|  1 | 2020-07-07 13:15:00 | VALIDATION PENDING     |       |\n",
      "|  2 | 2020-07-07 13:15:00 | OPEN PENDING           |       |\n",
      "|  3 | 2020-07-07 13:15:00 | OPEN                   |       |\n",
      "|  4 | 2020-07-07 13:15:00 | COMPLETE               |       |\n",
      "+----+---------------------+------------------------+-------+\n",
      "\n",
      "+-------------+---------------------+----------------------------------+------+\n",
      "| INST        | TIME                | ID                               | TT   |\n",
      "|-------------+---------------------+----------------------------------+------|\n",
      "| NSE_EQ:SBIN | 2020-07-07 15:30:00 | 527e82d96ffd4fdd96809576785dbeb7 | SELL |\n",
      "+-------------+---------------------+----------------------------------+------+\n",
      "+----+---------------------+------------------------+-------+\n",
      "|    | TIME                | STATE                  | MSG   |\n",
      "|----+---------------------+------------------------+-------|\n",
      "|  0 | 2020-07-07 15:30:00 | PUT ORDER REQ RECEIVED |       |\n",
      "|  1 | 2020-07-07 15:30:00 | VALIDATION PENDING     |       |\n",
      "|  2 | 2020-07-07 15:30:00 | OPEN PENDING           |       |\n",
      "|  3 | 2020-07-07 15:30:00 | OPEN                   |       |\n",
      "|  4 | 2020-07-07 15:30:00 | COMPLETE               |       |\n",
      "+----+---------------------+------------------------+-------+\n"
     ]
    }
   ],
   "source": [
    "order_history = algobulls_connection.get_backtesting_report_order_history(strategy_code1)\n",
    "print(order_history)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Recipe 7: MACD-Bracket-Order Strategy: Fetching the Strategy"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [],
   "source": [
    "from pyalgotrading.algobulls import AlgoBullsConnection"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [],
   "source": [
    "algobulls_connection = AlgoBullsConnection()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Please login to this URL with your AlgoBulls credentials and get your developer access token: https://app.algobulls.com/user/login\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "'https://app.algobulls.com/user/login'"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "algobulls_connection.get_authorization_url()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [],
   "source": [
    "algobulls_connection.set_access_token('80b7a69b168c5b3f15d56688841a8f2da5e2ab2c')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>strategyCode</th>\n",
       "      <th>strategyName</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>49287246f9704bbcbad76ade9e2091d9</td>\n",
       "      <td>EMA Regular Order Strategy</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>4faf514fe096432b8e9f80f5951bd2ea</td>\n",
       "      <td>MACD Bracket Order Strategy</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                       strategyCode                 strategyName\n",
       "0  49287246f9704bbcbad76ade9e2091d9   EMA Regular Order Strategy\n",
       "1  4faf514fe096432b8e9f80f5951bd2ea  MACD Bracket Order Strategy"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "all_strategies = algobulls_connection.get_all_strategies()\n",
    "all_strategies"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'4faf514fe096432b8e9f80f5951bd2ea'"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "strategy_code2 = all_strategies.iloc[1]['strategyCode']\n",
    "strategy_code2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "class StrategyMACDBracketOrder(StrategyBase):\n",
      "\n",
      "    def __init__(self, *args, **kwargs):\n",
      "        super().__init__(*args, **kwargs)\n",
      "\n",
      "        self.fastMA_period = self.strategy_parameters['fastma_period']\n",
      "        self.slowMA_period = self.strategy_parameters['slowma_period']\n",
      "        self.signal_period = self.strategy_parameters['signal_period']\n",
      "        self.stoploss = self.strategy_parameters['stoploss_trigger']\n",
      "        self.target = self.strategy_parameters['target_trigger']\n",
      "        self.trailing_stoploss = self.strategy_parameters['trailing_stoploss_trigger']\n",
      "\n",
      "        self.main_order = None\n",
      "\n",
      "    def initialize(self):\n",
      "        self.main_order = {}\n",
      "\n",
      "    @staticmethod\n",
      "    def name():\n",
      "        return 'MACD Bracket Order Strategy'\n",
      "\n",
      "    @staticmethod\n",
      "    def versions_supported():\n",
      "        return AlgoBullsEngineVersion.VERSION_3_2_0\n",
      "\n",
      "    def get_crossover_value(self, instrument):\n",
      "        hist_data = self.get_historical_data(instrument)\n",
      "        macdline, macdsignal, _ = talib.MACD(hist_data['close'],\n",
      "                                             fastperiod=self.fastMA_period,\n",
      "                                             slowperiod=self.slowMA_period,\n",
      "                                             signalperiod=self.signal_period)\n",
      "        crossover_value = self.utils.crossover(macdline, macdsignal)\n",
      "        return crossover_value\n",
      "\n",
      "    def strategy_select_instruments_for_entry(self, candle, instruments_bucket):\n",
      "\n",
      "        selected_instruments_bucket = []\n",
      "        sideband_info_bucket = []\n",
      "\n",
      "        for instrument in instruments_bucket:\n",
      "            crossover_value = self.get_crossover_value(instrument)\n",
      "            if crossover_value == 1:\n",
      "                selected_instruments_bucket.append(instrument)\n",
      "                sideband_info_bucket.append({'action': 'BUY'})\n",
      "            elif crossover_value == -1:\n",
      "                if self.strategy_mode is StrategyMode.INTRADAY:\n",
      "                    selected_instruments_bucket.append(instrument)\n",
      "                    sideband_info_bucket.append({'action': 'SELL'})\n",
      "\n",
      "        return selected_instruments_bucket, sideband_info_bucket\n",
      "\n",
      "    def strategy_enter_position(self, candle, instrument, sideband_info):\n",
      "        if sideband_info['action'] == 'BUY':\n",
      "            qty = self.number_of_lots * instrument.lot_size\n",
      "            ltp = self.broker.get_ltp(instrument)\n",
      "            self.main_order[instrument] = \\\n",
      "                self.broker.BuyOrderBracket(instrument=instrument,\n",
      "                                            order_code=BrokerOrderCodeConstants.INTRADAY,\n",
      "                                            order_variety=BrokerOrderVarietyConstants.LIMIT,\n",
      "                                            quantity=qty,\n",
      "                                            price=ltp,\n",
      "                                            stoploss_trigger=ltp - (ltp * self.stoploss),\n",
      "                                            target_trigger=ltp + (ltp * self.target),\n",
      "                                            trailing_stoploss_trigger=ltp * self.trailing_stoploss)\n",
      "\n",
      "        elif sideband_info['action'] == 'SELL':\n",
      "            qty = self.number_of_lots * instrument.lot_size\n",
      "            ltp = self.broker.get_ltp(instrument)\n",
      "            self.main_order[instrument] = \\\n",
      "                self.broker.SellOrderBracket(instrument=instrument,\n",
      "                                             order_code=BrokerOrderCodeConstants.INTRADAY,\n",
      "                                             order_variety=BrokerOrderVarietyConstants.LIMIT,\n",
      "                                             quantity=qty,\n",
      "                                             price=ltp,\n",
      "                                             stoploss_trigger=ltp + (ltp * self.stoploss),\n",
      "                                             target_trigger=ltp - (ltp * self.target),\n",
      "                                             trailing_stoploss_trigger=ltp * self.trailing_stoploss)\n",
      "        else:\n",
      "            raise SystemExit(f'Got invalid sideband_info value: {sideband_info}')\n",
      "\n",
      "        return self.main_order[instrument]\n",
      "\n",
      "    def strategy_select_instruments_for_exit(self, candle, instruments_bucket):\n",
      "        selected_instruments_bucket = []\n",
      "        sideband_info_bucket = []\n",
      "\n",
      "        for instrument in instruments_bucket:\n",
      "            if self.main_order.get(instrument) is not None:\n",
      "                crossover_value = self.get_crossover_value(instrument)\n",
      "                if crossover_value in [1, -1]:\n",
      "                    selected_instruments_bucket.append(instrument)\n",
      "                    sideband_info_bucket.append({'action': 'EXIT'})\n",
      "        return selected_instruments_bucket, sideband_info_bucket\n",
      "\n",
      "    def strategy_exit_position(self, candle, instrument, sideband_info):\n",
      "        if sideband_info['action'] == 'EXIT':\n",
      "            self.main_order[instrument].exit_position()\n",
      "            self.main_order[instrument] = None\n",
      "            return True\n",
      "\n",
      "        return False\n",
      "\n"
     ]
    }
   ],
   "source": [
    "strategy_details2 = algobulls_connection.get_strategy_details(strategy_code2)\n",
    "print(strategy_details2)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Recipe 8: MACD-Bracket-Order Strategy: Backtesting the Strategy"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [],
   "source": [
    "from datetime import datetime as dt\n",
    "from pyalgotrading.constants import *"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[{'id': 1, 'value': 'NSE:TATASTEEL'}]"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "instruments = algobulls_connection.search_instrument('TATASTEEL')\n",
    "instruments"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'NSE:TATASTEEL'"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "instrument = instruments[0]['value']\n",
    "instrument"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Setting Strategy Config... Success.\n",
      "Submitting BACKTESTING job... Success.\n"
     ]
    }
   ],
   "source": [
    "algobulls_connection.backtest(strategy_code=strategy_code2, \n",
    "                              start_timestamp=dt(year=2020, month=7, day=1, hour=9, minute=15),\n",
    "                              end_timestamp=dt(year=2020, month=7, day=7, hour=15, minute=30),\n",
    "                              instrument=instrument,\n",
    "                              lots=1,\n",
    "                              strategy_parameters={\n",
    "                                  'fastma_period': 26, \n",
    "                                  'slowma_period': 6, \n",
    "                                  'signal_period': 9,\n",
    "                                  'target_trigger': 0.01, \n",
    "                                  'stoploss_trigger': 0.01, \n",
    "                                  'trailing_stoploss_trigger': 1\n",
    "                              },\n",
    "                              candle_interval=CandleInterval.MINUTES_15)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'data': 'STARTING'}"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "algobulls_connection.get_backtesting_job_status(strategy_code2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'data': 'STARTED'}"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "algobulls_connection.get_backtesting_job_status(strategy_code2)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### There's more..."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Stopping BACKTESTING job... Success.\n"
     ]
    }
   ],
   "source": [
    "algobulls_connection.stop_backtesting_job(strategy_code2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'data': 'STOPPING'}"
      ]
     },
     "execution_count": 36,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "algobulls_connection.get_backtesting_job_status(strategy_code2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'data': 'STOPPED'}"
      ]
     },
     "execution_count": 37,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "algobulls_connection.get_backtesting_job_status(strategy_code2)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<img src=\"images/diagrams/abc-job-status-state-diagram.png\" width='50%'>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Recipe 9: MACD-Bracket-Order Strategy: Fetching Backtesting Logs in Realtime"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[2020-07-30 17:27:25] Logs not available yet. Please retry in sometime.\n"
     ]
    }
   ],
   "source": [
    "logs = algobulls_connection.get_backtesting_logs(strategy_code2)\n",
    "print(logs)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[2020-07-30 12:00:58] Performing sanity checks on cfg strategy_parameters, setting up broker connection and required data structures...\n",
      "[2020-07-30 12:00:58] ABBroker connection has been setup successfully.\n",
      "[2020-07-30 12:00:58] Sanity checks on cfg successful.\n",
      "[2020-07-30 12:00:58] Setting up broker connection...\n",
      "[2020-07-30 12:00:58] Broker connection has been setup successfully.\n",
      "[2020-07-30 12:00:58] (NSE_EQ) Funds available in client's ABVirtualBroker account is : Rs. '1000000000.00'\n",
      "[2020-07-30 12:00:58] \n",
      "########################################\n",
      " INITIALIZING ALGOBULLS CORE (v3.2.0 SECURE MODE)... \n",
      "########################################\n",
      "[2020-07-30 12:00:58] Welcome ALGOBULLS VIRTUAL USER!\n",
      "[2020-07-30 12:00:58] Reading strategy...\n",
      "[2020-07-30 12:00:58] Entering Backtesting mode. Henceforth, all timestamps will be backtesting timestamps...\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] STARTING ALGOBULLS CORE...\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] \n",
      "            \n",
      "  #####  #######    #    ######  ####### ### #     #  #####     \n",
      " #     #    #      # #   #     #    #     #  ##    # #     #    \n",
      " #          #     #   #  #     #    #     #  # #   # #          \n",
      "  #####     #    #     # ######     #     #  #  #  # #  ####    \n",
      "       #    #    ####### #   #      #     #  #   # # #     #    \n",
      " #     #    #    #     # #    #     #     #  #    ## #     #    \n",
      "  #####     #    #     # #     #    #    ### #     #  #####     \n",
      "\n",
      "    #    #        #####  ####### ######  #     # #       #        #####    \n",
      "   # #   #       #     # #     # #     # #     # #       #       #     #   \n",
      "  #   #  #       #       #     # #     # #     # #       #       #         \n",
      " #     # #       #  #### #     # ######  #     # #       #        #####    \n",
      " ####### #       #     # #     # #     # #     # #       #             #   \n",
      " #     # #       #     # #     # #     # #     # #       #       #     #   \n",
      " #     # #######  #####  ####### ######   #####  ####### #######  #####    \n",
      "\n",
      "  #####  ####### ######  #######\n",
      " #     # #     # #     # #\n",
      " #       #     # #     # #\n",
      " #       #     # ######  #####\n",
      " #       #     # #   #   #\n",
      " #     # #     # #    #  #\n",
      "  #####  ####### #     # #######\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] --------------------Master Cfg Parameters:--------------------\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] User: ALGOBULLS VIRTUAL USER\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] Broker: ABVIRTUALBROKER\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] AUTO_ADD_INSTRUMENTS_BUCKET_FROM_POSITIONS: False\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] AUTO_ADD_INSTRUMENTS_BUCKET_FROM_HOLDINGS_TPLUS1: False\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] AUTO_ADD_INSTRUMENTS_BUCKET_FROM_HOLDINGS_TPLUS2: False\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] RESUME_POSITIONS_ON_START: True\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] RESUME_HOLDINGS_TPLUS1_ON_START: True\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] RESUME_HOLDINGS_TPLUS2_ON_START: True\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] EXIT_INTRADAY_ORDERS_ON_STOP: False\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] EXIT_TPLUS1_DELIVERY_ORDERS_ON_STOP: False\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] EXIT_TPLUS2_DELIVERY_ORDERS_ON_STOP: False\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] --------------------User Cfg Parameters: System Parameters--------------------\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] Trading type: BACKTESTING\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] User trading start time: 2020-07-01 09:15:00\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] User trading end time: 2020-07-07 15:30:00\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] --------------------User Cfg Parameters: Funds Parameters--------------------\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] Credit Exposure: 1\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] Fund Allocator: FundAllocatorLots\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] Fund Allocator Parameters: {'NUMBER_OF_LOTS': 1}\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] --------------------User Cfg Parameters: Candle Parameters--------------------\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] Candle interval (sec): 900\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] --------------------User Cfg Parameters: Strategy Parameters--------------------\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] Strategy: MACD Bracket Order Strategy\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] Parameters: {'fastma_period': 26, 'signal_period': 9, 'slowma_period': 6, 'stoploss_trigger': 0.01, 'target_trigger': 0.01, 'trailing_stoploss_trigger': 1}\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] Strategy Mode: INTRADAY\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] Instruments Bucket: instruments_bucket | [NSE_EQ:TATASTEEL]\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] --------------------User Cfg Parameters: Risk Management Parameters--------------------\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] Target Trigger: 0.1000\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] Stoploss Trigger: 0.1000\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] Trailing Stoploss Trigger: 0.1000\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] Desired profit: 20000.0\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] Risk Appetite: 10000.0\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] PNL scan frequency (in sec): 30\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] --------------------User Cfg Parameters: Other Parameters--------------------\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] Allow multiple orders for same script: True\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] Allow new order when order for script already running: True\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] Instrument max orders count: 100\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] Remove Instrument if Order Rejected: False\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] ------------------------------------------------------------\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [utils] Instrument (NSE_EQ:TATASTEEL) subscribed to historical data successfully\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [utils] 1 Instrument(s) (re)subscribed to historical data successfully\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [utils] Prefetching historical data for 1 instruments...\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [strategy] \n",
      "####################\n",
      "Strategy Parameters:\n",
      "{'fastma_period': 26,\n",
      " 'signal_period': 9,\n",
      " 'slowma_period': 6,\n",
      " 'stoploss_trigger': 0.01,\n",
      " 'target_trigger': 0.01,\n",
      " 'trailing_stoploss_trigger': 1}\n",
      "####################\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [utils] 1 Instrument(s) (re)subscribed to historical data successfully\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] Opening current intraday positions, if any...\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [tls] Not processing holdings as STRATEGY_MODE is INTRADAY\n",
      "[BT] [2020-07-01 09:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-01 09:30:00)...\n",
      "[BT] [2020-07-01 09:30:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-01 09:45:00)...\n",
      "[BT] [2020-07-01 09:45:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-01 10:00:00)...\n",
      "[BT] [2020-07-01 10:00:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-01 10:15:00)...\n",
      "[BT] [2020-07-01 10:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-01 10:30:00)...\n",
      "[BT] [2020-07-01 10:30:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-01 10:45:00)...\n",
      "[BT] [2020-07-01 10:45:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-01 11:00:00)...\n",
      "[BT] [2020-07-01 11:00:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-01 11:15:00)...\n",
      "[BT] [2020-07-01 11:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-01 11:30:00)...\n",
      "[BT] [2020-07-01 11:30:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-01 11:45:00)...\n",
      "[BT] [2020-07-01 11:45:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-01 12:00:00)...\n",
      "[BT] [2020-07-01 12:00:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-01 12:15:00)...\n",
      "[BT] [2020-07-01 12:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-01 12:30:00)...\n",
      "[BT] [2020-07-01 12:30:00] [INFO] [tls] Entering position for instrument: NSE_EQ:TATASTEEL...\n",
      "[BT] [2020-07-01 12:30:00] [CRITICAL] [order] [PLACING NEW ORDER] [2020-07-01 12:30:00] [1cbefcf395c344c88a228a1b01c32ef6] [BUY] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 322.6] [PRICE:322.6] [TRIGGER PRICE:None] [ORDER_TYPE_BRACKET] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_ENTER] [STOPLOSS TRIGGER:319.374] [TARGET TRIGGER:325.826] [TRAILING STOPLOSS TRIGGER:322.6]\n",
      "[BT] [2020-07-01 12:30:00] [INFO] [positions] Created new Position: Position: [BUY] [NSE:TATASTEEL] [QTY:1] [ORDER_TYPE_BRACKET] [ORDER_CODE_INTRADAY]\n",
      "[BT] [2020-07-01 12:30:00] [INFO] [order] [ORDER ID RECEIVED] [ABVirtualBroker] [ID:1cbefcf395c344c88a228a1b01c32ef6] [BUY] [NSE_EQ:TATASTEEL] [Order ID: (Order: [2020-07-01 12:30:00] [1cbefcf395c344c88a228a1b01c32ef6] [BUY] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 322.6] [PRICE:322.6] [TRIGGER PRICE:None] [ORDER_TYPE_BRACKET] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_ENTER] [STOPLOSS TRIGGER:319.374] [TARGET TRIGGER:325.826] [TRAILING STOPLOSS TRIGGER:322.6])\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> COMPLETE)]\n",
      "[BT] [2020-07-01 12:30:00] [INFO] [order] [NEW ORDER SUCCESS] [2020-07-01 12:30:00] [1cbefcf395c344c88a228a1b01c32ef6] [BUY] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 322.6] [PRICE:322.6] [TRIGGER PRICE:None] [ORDER_TYPE_BRACKET] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_ENTER] [STOPLOSS TRIGGER:319.374] [TARGET TRIGGER:325.826] [TRAILING STOPLOSS TRIGGER:322.6] [STATUS:COMPLETE]\n",
      "[BT] [2020-07-01 12:30:00] [INFO] [tls] Instrument entered position: NSE_EQ:TATASTEEL. Order placed\n",
      "[BT] [2020-07-01 12:30:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-01 12:45:00)...\n",
      "[BT] [2020-07-01 12:45:00] [CRITICAL] [order] [PLACING NEW ORDER] [2020-07-01 12:45:00] [fb8be91cdc8e4d4f9c5f5ab9f7bf8934] [SELL] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 325.8] [PRICE:325.8] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_EXIT]\n",
      "[BT] [2020-07-01 12:45:00] [INFO] [order] [ORDER ID RECEIVED] [ABVirtualBroker] [ID:fb8be91cdc8e4d4f9c5f5ab9f7bf8934] [SELL] [NSE_EQ:TATASTEEL] [Order ID: (Order: [2020-07-01 12:45:00] [fb8be91cdc8e4d4f9c5f5ab9f7bf8934] [SELL] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 325.8] [PRICE:325.8] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_EXIT])\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN)]\n",
      "[BT] [2020-07-01 12:45:00] [INFO] [order] [NEW ORDER SUCCESS] [2020-07-01 12:45:00] [fb8be91cdc8e4d4f9c5f5ab9f7bf8934] [SELL] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 325.8] [PRICE:325.8] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_EXIT] [STATUS:OPEN]\n",
      "[BT] [2020-07-01 12:45:00] [CRITICAL] [order] [PLACING NEW ORDER] [2020-07-01 12:45:00] [972ffb502d1a4242ae9c1f5d16bdfc46] [SELL] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 319.35] [PRICE:319.35] [TRIGGER PRICE:319.35] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_STOPLOSS_LIMIT] [ORDER_POSITION_EXIT]\n",
      "[BT] [2020-07-01 12:45:00] [INFO] [order] [ORDER ID RECEIVED] [ABVirtualBroker] [ID:972ffb502d1a4242ae9c1f5d16bdfc46] [SELL] [NSE_EQ:TATASTEEL] [Order ID: (Order: [2020-07-01 12:45:00] [972ffb502d1a4242ae9c1f5d16bdfc46] [SELL] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 319.35] [PRICE:319.35] [TRIGGER PRICE:319.35] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_STOPLOSS_LIMIT] [ORDER_POSITION_EXIT])\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> TRIGGER PENDING)]\n",
      "[BT] [2020-07-01 12:45:00] [INFO] [order] [NEW ORDER SUCCESS] [2020-07-01 12:45:00] [972ffb502d1a4242ae9c1f5d16bdfc46] [SELL] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 319.35] [PRICE:319.35] [TRIGGER PRICE:319.35] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_STOPLOSS_LIMIT] [ORDER_POSITION_EXIT] [STATUS:TRIGGER PENDING]\n",
      "[BT] [2020-07-01 12:45:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-01 13:00:00)...\n",
      "[BT] [2020-07-01 13:00:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-01 13:15:00)...\n",
      "[BT] [2020-07-01 13:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-01 13:30:00)...\n",
      "[BT] [2020-07-01 13:30:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-01 13:45:00)...\n",
      "[BT] [2020-07-01 13:45:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-01 14:00:00)...\n",
      "[BT] [2020-07-01 14:00:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-01 14:15:00)...\n",
      "[BT] [2020-07-01 14:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-01 14:30:00)...\n",
      "[BT] [2020-07-01 14:30:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-01 14:45:00)...\n",
      "[BT] [2020-07-01 14:45:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-01 15:00:00)...\n",
      "[BT] [2020-07-01 15:00:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-01 15:15:00)...\n",
      "[BT] [2020-07-01 15:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-01 15:30:00)...\n",
      "[BT] [2020-07-01 15:30:00] [INFO] [oms] Exiting OPEN POSITION (Order: [2020-07-01 12:30:00] [1cbefcf395c344c88a228a1b01c32ef6] [BUY] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 322.6] [PRICE:322.6] [TRIGGER PRICE:None] [ORDER_TYPE_BRACKET] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_ENTER] [STOPLOSS TRIGGER:319.374] [TARGET TRIGGER:325.826] [TRAILING STOPLOSS TRIGGER:322.6])...\n",
      "[BT] [2020-07-01 15:30:00] [INFO] [order] Exiting child orders...\n",
      "[BT] [2020-07-01 15:30:00] [INFO] [order] Cancelling order... (Order: [2020-07-01 12:45:00] [fb8be91cdc8e4d4f9c5f5ab9f7bf8934] [SELL] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 325.8] [PRICE:325.8] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_EXIT])\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN)\n",
      "[BT] [2020-07-01 15:30:00] [INFO] [order] Cancelling order... (Order: [2020-07-01 12:45:00] [972ffb502d1a4242ae9c1f5d16bdfc46] [SELL] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 319.35] [PRICE:319.35] [TRIGGER PRICE:319.35] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_STOPLOSS_LIMIT] [ORDER_POSITION_EXIT])\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> TRIGGER PENDING)\n",
      "[BT] [2020-07-01 15:30:00] [INFO] [order] Exiting main bracket order...\n",
      "[BT] [2020-07-01 15:30:00] [CRITICAL] [order] [PLACING NEW ORDER] [2020-07-01 15:30:00] [c0d024b6a3be41f6a22efc826a8729aa] [SELL] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 324.1] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_EXIT]\n",
      "[BT] [2020-07-01 15:30:00] [INFO] [order] [ORDER ID RECEIVED] [ABVirtualBroker] [ID:c0d024b6a3be41f6a22efc826a8729aa] [SELL] [NSE_EQ:TATASTEEL] [Order ID: (Order: [2020-07-01 15:30:00] [c0d024b6a3be41f6a22efc826a8729aa] [SELL] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 0] [ENTRY PRICE: 324.1] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_EXIT])\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> COMPLETE)]\n",
      "[BT] [2020-07-01 15:30:00] [INFO] [order] [NEW ORDER SUCCESS] [2020-07-01 15:30:00] [c0d024b6a3be41f6a22efc826a8729aa] [SELL] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 0] [ENTRY PRICE: 324.1] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_EXIT] [STATUS:COMPLETE]\n",
      "[BT] [2020-07-02 09:15:00] [INFO] [utils] 1 Instrument(s) (re)subscribed to historical data successfully\n",
      "[BT] [2020-07-02 09:15:00] [INFO] [tls] Opening current intraday positions, if any...\n",
      "[BT] [2020-07-02 09:15:00] [INFO] [tls] Not processing holdings as STRATEGY_MODE is INTRADAY\n",
      "[BT] [2020-07-02 09:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-02 09:30:00)...\n",
      "[BT] [2020-07-02 09:30:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-02 09:45:00)...\n",
      "[BT] [2020-07-02 09:45:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-02 10:00:00)...\n",
      "[BT] [2020-07-02 10:00:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-02 10:15:00)...\n",
      "[BT] [2020-07-02 10:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-02 10:30:00)...\n",
      "[BT] [2020-07-02 10:30:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-02 10:45:00)...\n",
      "[BT] [2020-07-02 10:45:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-02 11:00:00)...\n",
      "[BT] [2020-07-02 11:00:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-02 11:15:00)...\n",
      "[BT] [2020-07-02 11:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-02 11:30:00)...\n",
      "[BT] [2020-07-02 11:30:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-02 11:45:00)...\n",
      "[BT] [2020-07-02 11:45:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-02 12:00:00)...\n",
      "[BT] [2020-07-02 12:00:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-02 12:15:00)...\n",
      "[BT] [2020-07-02 12:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-02 12:30:00)...\n",
      "[BT] [2020-07-02 12:30:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-02 12:45:00)...\n",
      "[BT] [2020-07-02 12:45:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-02 13:00:00)...\n",
      "[BT] [2020-07-02 13:00:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-02 13:15:00)...\n",
      "[BT] [2020-07-02 13:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-02 13:30:00)...\n",
      "[BT] [2020-07-02 13:30:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-02 13:45:00)...\n",
      "[BT] [2020-07-02 13:45:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-02 14:00:00)...\n",
      "[BT] [2020-07-02 14:00:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-02 14:15:00)...\n",
      "[BT] [2020-07-02 14:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-02 14:30:00)...\n",
      "[BT] [2020-07-02 14:30:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-02 14:45:00)...\n",
      "[BT] [2020-07-02 14:45:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-02 15:00:00)...\n",
      "[BT] [2020-07-02 15:00:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-02 15:15:00)...\n",
      "[BT] [2020-07-02 15:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-02 15:30:00)...\n",
      "[BT] [2020-07-03 09:15:00] [INFO] [utils] 1 Instrument(s) (re)subscribed to historical data successfully\n",
      "[BT] [2020-07-03 09:15:00] [INFO] [tls] Opening current intraday positions, if any...\n",
      "[BT] [2020-07-03 09:15:00] [INFO] [tls] Not processing holdings as STRATEGY_MODE is INTRADAY\n",
      "[BT] [2020-07-03 09:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-03 09:30:00)...\n",
      "[BT] [2020-07-03 09:30:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-03 09:45:00)...\n",
      "[BT] [2020-07-03 09:45:00] [INFO] [tls] Entering position for instrument: NSE_EQ:TATASTEEL...\n",
      "[BT] [2020-07-03 09:45:00] [CRITICAL] [order] [PLACING NEW ORDER] [2020-07-03 09:45:00] [ea5a4c6c63524f39a53de71f269ee256] [SELL] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 330.8] [PRICE:330.8] [TRIGGER PRICE:None] [ORDER_TYPE_BRACKET] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_ENTER] [STOPLOSS TRIGGER:334.108] [TARGET TRIGGER:327.492] [TRAILING STOPLOSS TRIGGER:330.8]\n",
      "[BT] [2020-07-03 09:45:00] [INFO] [positions] Created new Position: Position: [SELL] [NSE:TATASTEEL] [QTY:-1] [ORDER_TYPE_BRACKET] [ORDER_CODE_INTRADAY]\n",
      "[BT] [2020-07-03 09:45:00] [INFO] [order] [ORDER ID RECEIVED] [ABVirtualBroker] [ID:ea5a4c6c63524f39a53de71f269ee256] [SELL] [NSE_EQ:TATASTEEL] [Order ID: (Order: [2020-07-03 09:45:00] [ea5a4c6c63524f39a53de71f269ee256] [SELL] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 330.8] [PRICE:330.8] [TRIGGER PRICE:None] [ORDER_TYPE_BRACKET] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_ENTER] [STOPLOSS TRIGGER:334.108] [TARGET TRIGGER:327.492] [TRAILING STOPLOSS TRIGGER:330.8])\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> COMPLETE)]\n",
      "[BT] [2020-07-03 09:45:00] [INFO] [order] [NEW ORDER SUCCESS] [2020-07-03 09:45:00] [ea5a4c6c63524f39a53de71f269ee256] [SELL] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 330.8] [PRICE:330.8] [TRIGGER PRICE:None] [ORDER_TYPE_BRACKET] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_ENTER] [STOPLOSS TRIGGER:334.108] [TARGET TRIGGER:327.492] [TRAILING STOPLOSS TRIGGER:330.8] [STATUS:COMPLETE]\n",
      "[BT] [2020-07-03 09:45:00] [INFO] [tls] Instrument entered position: NSE_EQ:TATASTEEL. Order placed\n",
      "[BT] [2020-07-03 09:45:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-03 10:00:00)...\n",
      "[BT] [2020-07-03 10:00:00] [CRITICAL] [order] [PLACING NEW ORDER] [2020-07-03 10:00:00] [62458cf47d5f4a12b6c31c490451fdb0] [BUY] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 327.45] [PRICE:327.45] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_EXIT]\n",
      "[BT] [2020-07-03 10:00:00] [INFO] [order] [ORDER ID RECEIVED] [ABVirtualBroker] [ID:62458cf47d5f4a12b6c31c490451fdb0] [BUY] [NSE_EQ:TATASTEEL] [Order ID: (Order: [2020-07-03 10:00:00] [62458cf47d5f4a12b6c31c490451fdb0] [BUY] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 327.45] [PRICE:327.45] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_EXIT])\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN)]\n",
      "[BT] [2020-07-03 10:00:00] [INFO] [order] [NEW ORDER SUCCESS] [2020-07-03 10:00:00] [62458cf47d5f4a12b6c31c490451fdb0] [BUY] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 327.45] [PRICE:327.45] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_EXIT] [STATUS:OPEN]\n",
      "[BT] [2020-07-03 10:00:00] [CRITICAL] [order] [PLACING NEW ORDER] [2020-07-03 10:00:00] [03436b72ad8a47a8b29bb727876b0b95] [BUY] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 334.1] [PRICE:334.1] [TRIGGER PRICE:334.1] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_STOPLOSS_LIMIT] [ORDER_POSITION_EXIT]\n",
      "[BT] [2020-07-03 10:00:00] [INFO] [order] [ORDER ID RECEIVED] [ABVirtualBroker] [ID:03436b72ad8a47a8b29bb727876b0b95] [BUY] [NSE_EQ:TATASTEEL] [Order ID: (Order: [2020-07-03 10:00:00] [03436b72ad8a47a8b29bb727876b0b95] [BUY] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 334.1] [PRICE:334.1] [TRIGGER PRICE:334.1] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_STOPLOSS_LIMIT] [ORDER_POSITION_EXIT])\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> TRIGGER PENDING)]\n",
      "[BT] [2020-07-03 10:00:00] [INFO] [order] [NEW ORDER SUCCESS] [2020-07-03 10:00:00] [03436b72ad8a47a8b29bb727876b0b95] [BUY] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 334.1] [PRICE:334.1] [TRIGGER PRICE:334.1] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_STOPLOSS_LIMIT] [ORDER_POSITION_EXIT] [STATUS:TRIGGER PENDING]\n",
      "[BT] [2020-07-03 10:00:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-03 10:15:00)...\n",
      "[BT] [2020-07-03 10:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-03 10:30:00)...\n",
      "[BT] [2020-07-03 10:30:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-03 10:45:00)...\n",
      "[BT] [2020-07-03 10:45:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-03 11:00:00)...\n",
      "[BT] [2020-07-03 11:00:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-03 11:15:00)...\n",
      "[BT] [2020-07-03 11:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-03 11:30:00)...\n",
      "[BT] [2020-07-03 11:30:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-03 11:45:00)...\n",
      "[BT] [2020-07-03 11:45:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-03 12:00:00)...\n",
      "[BT] [2020-07-03 12:00:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-03 12:15:00)...\n",
      "[BT] [2020-07-03 12:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-03 12:30:00)...\n",
      "[BT] [2020-07-03 12:30:00] [WARNING] [order] [ID:ea5a4c6c63524f39a53de71f269ee256] [SELL] [NSE_EQ:TATASTEEL] Order was exited manually. Not exiting...\n",
      "[BT] [2020-07-03 12:30:00] [INFO] [tls] Entering position for instrument: NSE_EQ:TATASTEEL...\n",
      "[BT] [2020-07-03 12:30:00] [CRITICAL] [order] [PLACING NEW ORDER] [2020-07-03 12:30:00] [a88484f7888f496e801515ff400f69ea] [BUY] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 334.45] [PRICE:334.45] [TRIGGER PRICE:None] [ORDER_TYPE_BRACKET] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_ENTER] [STOPLOSS TRIGGER:331.1055] [TARGET TRIGGER:337.79449999999997] [TRAILING STOPLOSS TRIGGER:334.45]\n",
      "[BT] [2020-07-03 12:30:00] [INFO] [positions] Created new Position: Position: [BUY] [NSE:TATASTEEL] [QTY:1] [ORDER_TYPE_BRACKET] [ORDER_CODE_INTRADAY]\n",
      "[BT] [2020-07-03 12:30:00] [INFO] [order] [ORDER ID RECEIVED] [ABVirtualBroker] [ID:a88484f7888f496e801515ff400f69ea] [BUY] [NSE_EQ:TATASTEEL] [Order ID: (Order: [2020-07-03 12:30:00] [a88484f7888f496e801515ff400f69ea] [BUY] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 334.45] [PRICE:334.45] [TRIGGER PRICE:None] [ORDER_TYPE_BRACKET] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_ENTER] [STOPLOSS TRIGGER:331.1055] [TARGET TRIGGER:337.79449999999997] [TRAILING STOPLOSS TRIGGER:334.45])\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> COMPLETE)]\n",
      "[BT] [2020-07-03 12:30:00] [INFO] [order] [NEW ORDER SUCCESS] [2020-07-03 12:30:00] [a88484f7888f496e801515ff400f69ea] [BUY] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 334.45] [PRICE:334.45] [TRIGGER PRICE:None] [ORDER_TYPE_BRACKET] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_ENTER] [STOPLOSS TRIGGER:331.1055] [TARGET TRIGGER:337.79449999999997] [TRAILING STOPLOSS TRIGGER:334.45] [STATUS:COMPLETE]\n",
      "[BT] [2020-07-03 12:30:00] [INFO] [tls] Instrument entered position: NSE_EQ:TATASTEEL. Order placed\n",
      "[BT] [2020-07-03 12:30:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-03 12:45:00)...\n",
      "[BT] [2020-07-03 12:45:00] [CRITICAL] [order] [PLACING NEW ORDER] [2020-07-03 12:45:00] [f3c96875a80f41acb4c344febbc6cb43] [SELL] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 337.75] [PRICE:337.75] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_EXIT]\n",
      "[BT] [2020-07-03 12:45:00] [INFO] [order] [ORDER ID RECEIVED] [ABVirtualBroker] [ID:f3c96875a80f41acb4c344febbc6cb43] [SELL] [NSE_EQ:TATASTEEL] [Order ID: (Order: [2020-07-03 12:45:00] [f3c96875a80f41acb4c344febbc6cb43] [SELL] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 337.75] [PRICE:337.75] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_EXIT])\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN)]\n",
      "[BT] [2020-07-03 12:45:00] [INFO] [order] [NEW ORDER SUCCESS] [2020-07-03 12:45:00] [f3c96875a80f41acb4c344febbc6cb43] [SELL] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 337.75] [PRICE:337.75] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_EXIT] [STATUS:OPEN]\n",
      "[BT] [2020-07-03 12:45:00] [CRITICAL] [order] [PLACING NEW ORDER] [2020-07-03 12:45:00] [9a7b474106e549f084bb94dfe7686588] [SELL] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 331.1] [PRICE:331.1] [TRIGGER PRICE:331.1] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_STOPLOSS_LIMIT] [ORDER_POSITION_EXIT]\n",
      "[BT] [2020-07-03 12:45:00] [INFO] [order] [ORDER ID RECEIVED] [ABVirtualBroker] [ID:9a7b474106e549f084bb94dfe7686588] [SELL] [NSE_EQ:TATASTEEL] [Order ID: (Order: [2020-07-03 12:45:00] [9a7b474106e549f084bb94dfe7686588] [SELL] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 331.1] [PRICE:331.1] [TRIGGER PRICE:331.1] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_STOPLOSS_LIMIT] [ORDER_POSITION_EXIT])\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> TRIGGER PENDING)]\n",
      "[BT] [2020-07-03 12:45:00] [INFO] [order] [NEW ORDER SUCCESS] [2020-07-03 12:45:00] [9a7b474106e549f084bb94dfe7686588] [SELL] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 331.1] [PRICE:331.1] [TRIGGER PRICE:331.1] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_STOPLOSS_LIMIT] [ORDER_POSITION_EXIT] [STATUS:TRIGGER PENDING]\n",
      "[BT] [2020-07-03 12:45:00] [INFO] [order] Exiting child orders...\n",
      "[BT] [2020-07-03 12:45:00] [INFO] [order] Cancelling order... (Order: [2020-07-03 12:45:00] [f3c96875a80f41acb4c344febbc6cb43] [SELL] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 337.75] [PRICE:337.75] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_EXIT])\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN)\n",
      "[BT] [2020-07-03 12:45:00] [INFO] [order] Cancelling order... (Order: [2020-07-03 12:45:00] [9a7b474106e549f084bb94dfe7686588] [SELL] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 331.1] [PRICE:331.1] [TRIGGER PRICE:331.1] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_STOPLOSS_LIMIT] [ORDER_POSITION_EXIT])\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> TRIGGER PENDING)\n",
      "[BT] [2020-07-03 12:45:00] [INFO] [order] Exiting main bracket order...\n",
      "[BT] [2020-07-03 12:45:00] [CRITICAL] [order] [PLACING NEW ORDER] [2020-07-03 12:45:00] [1dab5ff3edb046918fe45d43f189341e] [SELL] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 333.5] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_EXIT]\n",
      "[BT] [2020-07-03 12:45:00] [INFO] [order] [ORDER ID RECEIVED] [ABVirtualBroker] [ID:1dab5ff3edb046918fe45d43f189341e] [SELL] [NSE_EQ:TATASTEEL] [Order ID: (Order: [2020-07-03 12:45:00] [1dab5ff3edb046918fe45d43f189341e] [SELL] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 0] [ENTRY PRICE: 333.5] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_EXIT])\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> COMPLETE)]\n",
      "[BT] [2020-07-03 12:45:00] [INFO] [order] [NEW ORDER SUCCESS] [2020-07-03 12:45:00] [1dab5ff3edb046918fe45d43f189341e] [SELL] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 0] [ENTRY PRICE: 333.5] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_EXIT] [STATUS:COMPLETE]\n",
      "[BT] [2020-07-03 12:45:00] [INFO] [tls] Entering position for instrument: NSE_EQ:TATASTEEL...\n",
      "[BT] [2020-07-03 12:45:00] [CRITICAL] [order] [PLACING NEW ORDER] [2020-07-03 12:45:00] [32948c0159da4481891bd29daec2ff0a] [SELL] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 333.5] [PRICE:333.5] [TRIGGER PRICE:None] [ORDER_TYPE_BRACKET] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_ENTER] [STOPLOSS TRIGGER:336.835] [TARGET TRIGGER:330.165] [TRAILING STOPLOSS TRIGGER:333.5]\n",
      "[BT] [2020-07-03 12:45:00] [INFO] [positions] Created new Position: Position: [SELL] [NSE:TATASTEEL] [QTY:-1] [ORDER_TYPE_BRACKET] [ORDER_CODE_INTRADAY]\n",
      "[BT] [2020-07-03 12:45:00] [INFO] [order] [ORDER ID RECEIVED] [ABVirtualBroker] [ID:32948c0159da4481891bd29daec2ff0a] [SELL] [NSE_EQ:TATASTEEL] [Order ID: (Order: [2020-07-03 12:45:00] [32948c0159da4481891bd29daec2ff0a] [SELL] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 333.5] [PRICE:333.5] [TRIGGER PRICE:None] [ORDER_TYPE_BRACKET] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_ENTER] [STOPLOSS TRIGGER:336.835] [TARGET TRIGGER:330.165] [TRAILING STOPLOSS TRIGGER:333.5])\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> COMPLETE)]\n",
      "[BT] [2020-07-03 12:45:00] [INFO] [order] [NEW ORDER SUCCESS] [2020-07-03 12:45:00] [32948c0159da4481891bd29daec2ff0a] [SELL] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 333.5] [PRICE:333.5] [TRIGGER PRICE:None] [ORDER_TYPE_BRACKET] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_ENTER] [STOPLOSS TRIGGER:336.835] [TARGET TRIGGER:330.165] [TRAILING STOPLOSS TRIGGER:333.5] [STATUS:COMPLETE]\n",
      "[BT] [2020-07-03 12:45:00] [INFO] [tls] Instrument entered position: NSE_EQ:TATASTEEL. Order placed\n",
      "[BT] [2020-07-03 12:45:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-03 13:00:00)...\n",
      "[BT] [2020-07-03 13:00:00] [CRITICAL] [order] [PLACING NEW ORDER] [2020-07-03 13:00:00] [6f1fdd54207f499aae0d71ba41a94891] [BUY] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 330.15] [PRICE:330.15] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_EXIT]\n",
      "[BT] [2020-07-03 13:00:00] [INFO] [order] [ORDER ID RECEIVED] [ABVirtualBroker] [ID:6f1fdd54207f499aae0d71ba41a94891] [BUY] [NSE_EQ:TATASTEEL] [Order ID: (Order: [2020-07-03 13:00:00] [6f1fdd54207f499aae0d71ba41a94891] [BUY] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 330.15] [PRICE:330.15] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_EXIT])\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN)]\n",
      "[BT] [2020-07-03 13:00:00] [INFO] [order] [NEW ORDER SUCCESS] [2020-07-03 13:00:00] [6f1fdd54207f499aae0d71ba41a94891] [BUY] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 330.15] [PRICE:330.15] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_EXIT] [STATUS:OPEN]\n",
      "[BT] [2020-07-03 13:00:00] [CRITICAL] [order] [PLACING NEW ORDER] [2020-07-03 13:00:00] [446a3850abf145288dff03854fa20ec3] [BUY] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 336.8] [PRICE:336.8] [TRIGGER PRICE:336.8] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_STOPLOSS_LIMIT] [ORDER_POSITION_EXIT]\n",
      "[BT] [2020-07-03 13:00:00] [INFO] [order] [ORDER ID RECEIVED] [ABVirtualBroker] [ID:446a3850abf145288dff03854fa20ec3] [BUY] [NSE_EQ:TATASTEEL] [Order ID: (Order: [2020-07-03 13:00:00] [446a3850abf145288dff03854fa20ec3] [BUY] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 336.8] [PRICE:336.8] [TRIGGER PRICE:336.8] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_STOPLOSS_LIMIT] [ORDER_POSITION_EXIT])\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> TRIGGER PENDING)]\n",
      "[BT] [2020-07-03 13:00:00] [INFO] [order] [NEW ORDER SUCCESS] [2020-07-03 13:00:00] [446a3850abf145288dff03854fa20ec3] [BUY] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 336.8] [PRICE:336.8] [TRIGGER PRICE:336.8] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_STOPLOSS_LIMIT] [ORDER_POSITION_EXIT] [STATUS:TRIGGER PENDING]\n",
      "[BT] [2020-07-03 13:00:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-03 13:15:00)...\n",
      "[BT] [2020-07-03 13:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-03 13:30:00)...\n",
      "[BT] [2020-07-03 13:30:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-03 13:45:00)...\n",
      "[BT] [2020-07-03 13:45:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-03 14:00:00)...\n",
      "[BT] [2020-07-03 14:00:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-03 14:15:00)...\n",
      "[BT] [2020-07-03 14:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-03 14:30:00)...\n",
      "[BT] [2020-07-03 14:30:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-03 14:45:00)...\n",
      "[BT] [2020-07-03 14:45:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-03 15:00:00)...\n",
      "[BT] [2020-07-03 15:00:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-03 15:15:00)...\n",
      "[BT] [2020-07-03 15:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-03 15:30:00)...\n",
      "[BT] [2020-07-06 09:15:00] [INFO] [utils] 1 Instrument(s) (re)subscribed to historical data successfully\n",
      "[BT] [2020-07-06 09:15:00] [INFO] [tls] Opening current intraday positions, if any...\n",
      "[BT] [2020-07-06 09:15:00] [INFO] [tls] Not processing holdings as STRATEGY_MODE is INTRADAY\n",
      "[BT] [2020-07-06 09:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-06 09:30:00)...\n",
      "[BT] [2020-07-06 09:30:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-06 09:45:00)...\n",
      "[BT] [2020-07-06 09:45:00] [INFO] [tls] Entering position for instrument: NSE_EQ:TATASTEEL...\n",
      "[BT] [2020-07-06 09:45:00] [CRITICAL] [order] [PLACING NEW ORDER] [2020-07-06 09:45:00] [0f4ae537fdf643f2901eeb4aa3bc4a0f] [BUY] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 332.35] [PRICE:332.35] [TRIGGER PRICE:None] [ORDER_TYPE_BRACKET] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_ENTER] [STOPLOSS TRIGGER:329.0265] [TARGET TRIGGER:335.67350000000005] [TRAILING STOPLOSS TRIGGER:332.35]\n",
      "[BT] [2020-07-06 09:45:00] [INFO] [positions] Created new Position: Position: [BUY] [NSE:TATASTEEL] [QTY:1] [ORDER_TYPE_BRACKET] [ORDER_CODE_INTRADAY]\n",
      "[BT] [2020-07-06 09:45:00] [INFO] [order] [ORDER ID RECEIVED] [ABVirtualBroker] [ID:0f4ae537fdf643f2901eeb4aa3bc4a0f] [BUY] [NSE_EQ:TATASTEEL] [Order ID: (Order: [2020-07-06 09:45:00] [0f4ae537fdf643f2901eeb4aa3bc4a0f] [BUY] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 332.35] [PRICE:332.35] [TRIGGER PRICE:None] [ORDER_TYPE_BRACKET] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_ENTER] [STOPLOSS TRIGGER:329.0265] [TARGET TRIGGER:335.67350000000005] [TRAILING STOPLOSS TRIGGER:332.35])\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> COMPLETE)]\n",
      "[BT] [2020-07-06 09:45:00] [INFO] [order] [NEW ORDER SUCCESS] [2020-07-06 09:45:00] [0f4ae537fdf643f2901eeb4aa3bc4a0f] [BUY] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 332.35] [PRICE:332.35] [TRIGGER PRICE:None] [ORDER_TYPE_BRACKET] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_ENTER] [STOPLOSS TRIGGER:329.0265] [TARGET TRIGGER:335.67350000000005] [TRAILING STOPLOSS TRIGGER:332.35] [STATUS:COMPLETE]\n",
      "[BT] [2020-07-06 09:45:00] [INFO] [tls] Instrument entered position: NSE_EQ:TATASTEEL. Order placed\n",
      "[BT] [2020-07-06 09:45:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-06 10:00:00)...\n",
      "[BT] [2020-07-06 10:00:00] [CRITICAL] [order] [PLACING NEW ORDER] [2020-07-06 10:00:00] [5acd4ba4137243978efd9aec9054c329] [SELL] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 335.65] [PRICE:335.65] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_EXIT]\n",
      "[BT] [2020-07-06 10:00:00] [INFO] [order] [ORDER ID RECEIVED] [ABVirtualBroker] [ID:5acd4ba4137243978efd9aec9054c329] [SELL] [NSE_EQ:TATASTEEL] [Order ID: (Order: [2020-07-06 10:00:00] [5acd4ba4137243978efd9aec9054c329] [SELL] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 335.65] [PRICE:335.65] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_EXIT])\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN)]\n",
      "[BT] [2020-07-06 10:00:00] [INFO] [order] [NEW ORDER SUCCESS] [2020-07-06 10:00:00] [5acd4ba4137243978efd9aec9054c329] [SELL] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 335.65] [PRICE:335.65] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_EXIT] [STATUS:OPEN]\n",
      "[BT] [2020-07-06 10:00:00] [CRITICAL] [order] [PLACING NEW ORDER] [2020-07-06 10:00:00] [8e03fe4428954257af26ee042debd62e] [SELL] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 329.0] [PRICE:329.0] [TRIGGER PRICE:329.0] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_STOPLOSS_LIMIT] [ORDER_POSITION_EXIT]\n",
      "[BT] [2020-07-06 10:00:00] [INFO] [order] [ORDER ID RECEIVED] [ABVirtualBroker] [ID:8e03fe4428954257af26ee042debd62e] [SELL] [NSE_EQ:TATASTEEL] [Order ID: (Order: [2020-07-06 10:00:00] [8e03fe4428954257af26ee042debd62e] [SELL] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 329.0] [PRICE:329.0] [TRIGGER PRICE:329.0] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_STOPLOSS_LIMIT] [ORDER_POSITION_EXIT])\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> TRIGGER PENDING)]\n",
      "[BT] [2020-07-06 10:00:00] [INFO] [order] [NEW ORDER SUCCESS] [2020-07-06 10:00:00] [8e03fe4428954257af26ee042debd62e] [SELL] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 329.0] [PRICE:329.0] [TRIGGER PRICE:329.0] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_STOPLOSS_LIMIT] [ORDER_POSITION_EXIT] [STATUS:TRIGGER PENDING]\n",
      "[BT] [2020-07-06 10:00:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-06 10:15:00)...\n",
      "[BT] [2020-07-06 10:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-06 10:30:00)...\n",
      "[BT] [2020-07-06 10:30:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-06 10:45:00)...\n",
      "[BT] [2020-07-06 10:45:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-06 11:00:00)...\n",
      "[BT] [2020-07-06 11:00:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-06 11:15:00)...\n",
      "[BT] [2020-07-06 11:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-06 11:30:00)...\n",
      "[BT] [2020-07-06 11:30:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-06 11:45:00)...\n",
      "[BT] [2020-07-06 11:45:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-06 12:00:00)...\n",
      "[BT] [2020-07-06 12:00:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-06 12:15:00)...\n",
      "[BT] [2020-07-06 12:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-06 12:30:00)...\n",
      "[BT] [2020-07-06 12:30:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-06 12:45:00)...\n",
      "[BT] [2020-07-06 12:45:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-06 13:00:00)...\n",
      "[BT] [2020-07-06 13:00:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-06 13:15:00)...\n",
      "[BT] [2020-07-06 13:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-06 13:30:00)...\n",
      "[BT] [2020-07-06 13:30:00] [WARNING] [order] [ID:0f4ae537fdf643f2901eeb4aa3bc4a0f] [BUY] [NSE_EQ:TATASTEEL] Order was exited manually. Not exiting...\n",
      "[BT] [2020-07-06 13:30:00] [INFO] [tls] Entering position for instrument: NSE_EQ:TATASTEEL...\n",
      "[BT] [2020-07-06 13:30:00] [CRITICAL] [order] [PLACING NEW ORDER] [2020-07-06 13:30:00] [b0400fc8e77941f8b72ace6bc3d53bca] [SELL] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 339.65] [PRICE:339.65] [TRIGGER PRICE:None] [ORDER_TYPE_BRACKET] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_ENTER] [STOPLOSS TRIGGER:343.0465] [TARGET TRIGGER:336.2535] [TRAILING STOPLOSS TRIGGER:339.65]\n",
      "[BT] [2020-07-06 13:30:00] [INFO] [positions] Created new Position: Position: [SELL] [NSE:TATASTEEL] [QTY:-1] [ORDER_TYPE_BRACKET] [ORDER_CODE_INTRADAY]\n",
      "[BT] [2020-07-06 13:30:00] [INFO] [order] [ORDER ID RECEIVED] [ABVirtualBroker] [ID:b0400fc8e77941f8b72ace6bc3d53bca] [SELL] [NSE_EQ:TATASTEEL] [Order ID: (Order: [2020-07-06 13:30:00] [b0400fc8e77941f8b72ace6bc3d53bca] [SELL] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 339.65] [PRICE:339.65] [TRIGGER PRICE:None] [ORDER_TYPE_BRACKET] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_ENTER] [STOPLOSS TRIGGER:343.0465] [TARGET TRIGGER:336.2535] [TRAILING STOPLOSS TRIGGER:339.65])\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> COMPLETE)]\n",
      "[BT] [2020-07-06 13:30:00] [INFO] [order] [NEW ORDER SUCCESS] [2020-07-06 13:30:00] [b0400fc8e77941f8b72ace6bc3d53bca] [SELL] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 339.65] [PRICE:339.65] [TRIGGER PRICE:None] [ORDER_TYPE_BRACKET] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_ENTER] [STOPLOSS TRIGGER:343.0465] [TARGET TRIGGER:336.2535] [TRAILING STOPLOSS TRIGGER:339.65] [STATUS:COMPLETE]\n",
      "[BT] [2020-07-06 13:30:00] [INFO] [tls] Instrument entered position: NSE_EQ:TATASTEEL. Order placed\n",
      "[BT] [2020-07-06 13:30:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-06 13:45:00)...\n",
      "[BT] [2020-07-06 13:45:00] [CRITICAL] [order] [PLACING NEW ORDER] [2020-07-06 13:45:00] [7d8525013a694cdd81be74755037d7c0] [BUY] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 336.25] [PRICE:336.25] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_EXIT]\n",
      "[BT] [2020-07-06 13:45:00] [INFO] [order] [ORDER ID RECEIVED] [ABVirtualBroker] [ID:7d8525013a694cdd81be74755037d7c0] [BUY] [NSE_EQ:TATASTEEL] [Order ID: (Order: [2020-07-06 13:45:00] [7d8525013a694cdd81be74755037d7c0] [BUY] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 336.25] [PRICE:336.25] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_EXIT])\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN)]\n",
      "[BT] [2020-07-06 13:45:00] [INFO] [order] [NEW ORDER SUCCESS] [2020-07-06 13:45:00] [7d8525013a694cdd81be74755037d7c0] [BUY] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 336.25] [PRICE:336.25] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_EXIT] [STATUS:OPEN]\n",
      "[BT] [2020-07-06 13:45:00] [CRITICAL] [order] [PLACING NEW ORDER] [2020-07-06 13:45:00] [984310d2323541c8a5d0b5303ab40bad] [BUY] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 343.0] [PRICE:343.0] [TRIGGER PRICE:343.0] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_STOPLOSS_LIMIT] [ORDER_POSITION_EXIT]\n",
      "[BT] [2020-07-06 13:45:00] [INFO] [order] [ORDER ID RECEIVED] [ABVirtualBroker] [ID:984310d2323541c8a5d0b5303ab40bad] [BUY] [NSE_EQ:TATASTEEL] [Order ID: (Order: [2020-07-06 13:45:00] [984310d2323541c8a5d0b5303ab40bad] [BUY] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 343.0] [PRICE:343.0] [TRIGGER PRICE:343.0] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_STOPLOSS_LIMIT] [ORDER_POSITION_EXIT])\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> TRIGGER PENDING)]\n",
      "[BT] [2020-07-06 13:45:00] [INFO] [order] [NEW ORDER SUCCESS] [2020-07-06 13:45:00] [984310d2323541c8a5d0b5303ab40bad] [BUY] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 343.0] [PRICE:343.0] [TRIGGER PRICE:343.0] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_STOPLOSS_LIMIT] [ORDER_POSITION_EXIT] [STATUS:TRIGGER PENDING]\n",
      "[BT] [2020-07-06 13:45:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-06 14:00:00)...\n",
      "[BT] [2020-07-06 14:00:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-06 14:15:00)...\n",
      "[BT] [2020-07-06 14:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-06 14:30:00)...\n",
      "[BT] [2020-07-06 14:30:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-06 14:45:00)...\n",
      "[BT] [2020-07-06 14:45:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-06 15:00:00)...\n",
      "[BT] [2020-07-06 15:00:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-06 15:15:00)...\n",
      "[BT] [2020-07-06 15:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-06 15:30:00)...\n",
      "[BT] [2020-07-06 15:30:00] [INFO] [oms] Exiting OPEN POSITION (Order: [2020-07-06 13:30:00] [b0400fc8e77941f8b72ace6bc3d53bca] [SELL] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 339.65] [PRICE:339.65] [TRIGGER PRICE:None] [ORDER_TYPE_BRACKET] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_ENTER] [STOPLOSS TRIGGER:343.0465] [TARGET TRIGGER:336.2535] [TRAILING STOPLOSS TRIGGER:339.65])...\n",
      "[BT] [2020-07-06 15:30:00] [INFO] [order] Exiting child orders...\n",
      "[BT] [2020-07-06 15:30:00] [INFO] [order] Cancelling order... (Order: [2020-07-06 13:45:00] [7d8525013a694cdd81be74755037d7c0] [BUY] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 336.25] [PRICE:336.25] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_EXIT])\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN)\n",
      "[BT] [2020-07-06 15:30:00] [INFO] [order] Cancelling order... (Order: [2020-07-06 13:45:00] [984310d2323541c8a5d0b5303ab40bad] [BUY] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 343.0] [PRICE:343.0] [TRIGGER PRICE:343.0] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_STOPLOSS_LIMIT] [ORDER_POSITION_EXIT])\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> TRIGGER PENDING)\n",
      "[BT] [2020-07-06 15:30:00] [INFO] [order] Exiting main bracket order...\n",
      "[BT] [2020-07-06 15:30:00] [CRITICAL] [order] [PLACING NEW ORDER] [2020-07-06 15:30:00] [f1c18daa21904a4abe92dc4d56574719] [BUY] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 338.85] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_EXIT]\n",
      "[BT] [2020-07-06 15:30:00] [INFO] [order] [ORDER ID RECEIVED] [ABVirtualBroker] [ID:f1c18daa21904a4abe92dc4d56574719] [BUY] [NSE_EQ:TATASTEEL] [Order ID: (Order: [2020-07-06 15:30:00] [f1c18daa21904a4abe92dc4d56574719] [BUY] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 0] [ENTRY PRICE: 338.85] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_EXIT])\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> COMPLETE)]\n",
      "[BT] [2020-07-06 15:30:00] [INFO] [order] [NEW ORDER SUCCESS] [2020-07-06 15:30:00] [f1c18daa21904a4abe92dc4d56574719] [BUY] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 0] [ENTRY PRICE: 338.85] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_EXIT] [STATUS:COMPLETE]\n",
      "[BT] [2020-07-07 09:15:00] [INFO] [utils] 1 Instrument(s) (re)subscribed to historical data successfully\n",
      "[BT] [2020-07-07 09:15:00] [INFO] [tls] Opening current intraday positions, if any...\n",
      "[BT] [2020-07-07 09:15:00] [INFO] [tls] Not processing holdings as STRATEGY_MODE is INTRADAY\n",
      "[BT] [2020-07-07 09:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-07 09:30:00)...\n",
      "[BT] [2020-07-07 09:30:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-07 09:45:00)...\n",
      "[BT] [2020-07-07 09:45:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-07 10:00:00)...\n",
      "[BT] [2020-07-07 10:00:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-07 10:15:00)...\n",
      "[BT] [2020-07-07 10:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-07 10:30:00)...\n",
      "[BT] [2020-07-07 10:30:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-07 10:45:00)...\n",
      "[BT] [2020-07-07 10:45:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-07 11:00:00)...\n",
      "[BT] [2020-07-07 11:00:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-07 11:15:00)...\n",
      "[BT] [2020-07-07 11:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-07 11:30:00)...\n",
      "[BT] [2020-07-07 11:30:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-07 11:45:00)...\n",
      "[BT] [2020-07-07 11:45:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-07 12:00:00)...\n",
      "[BT] [2020-07-07 12:00:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-07 12:15:00)...\n",
      "[BT] [2020-07-07 12:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-07 12:30:00)...\n",
      "[BT] [2020-07-07 12:30:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-07 12:45:00)...\n",
      "[BT] [2020-07-07 12:45:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-07 13:00:00)...\n",
      "[BT] [2020-07-07 13:00:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-07 13:15:00)...\n",
      "[BT] [2020-07-07 13:15:00] [INFO] [tls] Entering position for instrument: NSE_EQ:TATASTEEL...\n",
      "[BT] [2020-07-07 13:15:00] [CRITICAL] [order] [PLACING NEW ORDER] [2020-07-07 13:15:00] [311caaf7d5564030be54069c0998a7e4] [BUY] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 332.6] [PRICE:332.6] [TRIGGER PRICE:None] [ORDER_TYPE_BRACKET] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_ENTER] [STOPLOSS TRIGGER:329.274] [TARGET TRIGGER:335.92600000000004] [TRAILING STOPLOSS TRIGGER:332.6]\n",
      "[BT] [2020-07-07 13:15:00] [INFO] [positions] Created new Position: Position: [BUY] [NSE:TATASTEEL] [QTY:1] [ORDER_TYPE_BRACKET] [ORDER_CODE_INTRADAY]\n",
      "[BT] [2020-07-07 13:15:00] [INFO] [order] [ORDER ID RECEIVED] [ABVirtualBroker] [ID:311caaf7d5564030be54069c0998a7e4] [BUY] [NSE_EQ:TATASTEEL] [Order ID: (Order: [2020-07-07 13:15:00] [311caaf7d5564030be54069c0998a7e4] [BUY] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 332.6] [PRICE:332.6] [TRIGGER PRICE:None] [ORDER_TYPE_BRACKET] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_ENTER] [STOPLOSS TRIGGER:329.274] [TARGET TRIGGER:335.92600000000004] [TRAILING STOPLOSS TRIGGER:332.6])\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> COMPLETE)]\n",
      "[BT] [2020-07-07 13:15:00] [INFO] [order] [NEW ORDER SUCCESS] [2020-07-07 13:15:00] [311caaf7d5564030be54069c0998a7e4] [BUY] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 332.6] [PRICE:332.6] [TRIGGER PRICE:None] [ORDER_TYPE_BRACKET] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_ENTER] [STOPLOSS TRIGGER:329.274] [TARGET TRIGGER:335.92600000000004] [TRAILING STOPLOSS TRIGGER:332.6] [STATUS:COMPLETE]\n",
      "[BT] [2020-07-07 13:15:00] [INFO] [tls] Instrument entered position: NSE_EQ:TATASTEEL. Order placed\n",
      "[BT] [2020-07-07 13:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-07 13:30:00)...\n",
      "[BT] [2020-07-07 13:30:00] [CRITICAL] [order] [PLACING NEW ORDER] [2020-07-07 13:30:00] [1d2d37f3a4004907a44948eb74bf5e6d] [SELL] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 335.9] [PRICE:335.9] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_EXIT]\n",
      "[BT] [2020-07-07 13:30:00] [INFO] [order] [ORDER ID RECEIVED] [ABVirtualBroker] [ID:1d2d37f3a4004907a44948eb74bf5e6d] [SELL] [NSE_EQ:TATASTEEL] [Order ID: (Order: [2020-07-07 13:30:00] [1d2d37f3a4004907a44948eb74bf5e6d] [SELL] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 335.9] [PRICE:335.9] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_EXIT])\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN)]\n",
      "[BT] [2020-07-07 13:30:00] [INFO] [order] [NEW ORDER SUCCESS] [2020-07-07 13:30:00] [1d2d37f3a4004907a44948eb74bf5e6d] [SELL] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 335.9] [PRICE:335.9] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_EXIT] [STATUS:OPEN]\n",
      "[BT] [2020-07-07 13:30:00] [CRITICAL] [order] [PLACING NEW ORDER] [2020-07-07 13:30:00] [e228d5c2165048eebc28db14e428c200] [SELL] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 329.25] [PRICE:329.25] [TRIGGER PRICE:329.25] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_STOPLOSS_LIMIT] [ORDER_POSITION_EXIT]\n",
      "[BT] [2020-07-07 13:30:00] [INFO] [order] [ORDER ID RECEIVED] [ABVirtualBroker] [ID:e228d5c2165048eebc28db14e428c200] [SELL] [NSE_EQ:TATASTEEL] [Order ID: (Order: [2020-07-07 13:30:00] [e228d5c2165048eebc28db14e428c200] [SELL] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 329.25] [PRICE:329.25] [TRIGGER PRICE:329.25] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_STOPLOSS_LIMIT] [ORDER_POSITION_EXIT])\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> TRIGGER PENDING)]\n",
      "[BT] [2020-07-07 13:30:00] [INFO] [order] [NEW ORDER SUCCESS] [2020-07-07 13:30:00] [e228d5c2165048eebc28db14e428c200] [SELL] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 329.25] [PRICE:329.25] [TRIGGER PRICE:329.25] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_STOPLOSS_LIMIT] [ORDER_POSITION_EXIT] [STATUS:TRIGGER PENDING]\n",
      "[BT] [2020-07-07 13:30:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-07 13:45:00)...\n",
      "[BT] [2020-07-07 13:45:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-07 14:00:00)...\n",
      "[BT] [2020-07-07 14:00:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-07 14:15:00)...\n",
      "[BT] [2020-07-07 14:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-07 14:30:00)...\n",
      "[BT] [2020-07-07 14:30:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-07 14:45:00)...\n",
      "[BT] [2020-07-07 14:45:00] [WARNING] [order] [ID:311caaf7d5564030be54069c0998a7e4] [BUY] [NSE_EQ:TATASTEEL] Order was exited manually. Not exiting...\n",
      "[BT] [2020-07-07 14:45:00] [INFO] [tls] Entering position for instrument: NSE_EQ:TATASTEEL...\n",
      "[BT] [2020-07-07 14:45:00] [CRITICAL] [order] [PLACING NEW ORDER] [2020-07-07 14:45:00] [b5c5a86c76fb4f7f845ac7d9087501ae] [SELL] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 329.3] [PRICE:329.3] [TRIGGER PRICE:None] [ORDER_TYPE_BRACKET] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_ENTER] [STOPLOSS TRIGGER:332.593] [TARGET TRIGGER:326.007] [TRAILING STOPLOSS TRIGGER:329.3]\n",
      "[BT] [2020-07-07 14:45:00] [INFO] [positions] Created new Position: Position: [SELL] [NSE:TATASTEEL] [QTY:-1] [ORDER_TYPE_BRACKET] [ORDER_CODE_INTRADAY]\n",
      "[BT] [2020-07-07 14:45:00] [INFO] [order] [ORDER ID RECEIVED] [ABVirtualBroker] [ID:b5c5a86c76fb4f7f845ac7d9087501ae] [SELL] [NSE_EQ:TATASTEEL] [Order ID: (Order: [2020-07-07 14:45:00] [b5c5a86c76fb4f7f845ac7d9087501ae] [SELL] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 329.3] [PRICE:329.3] [TRIGGER PRICE:None] [ORDER_TYPE_BRACKET] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_ENTER] [STOPLOSS TRIGGER:332.593] [TARGET TRIGGER:326.007] [TRAILING STOPLOSS TRIGGER:329.3])\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> COMPLETE)]\n",
      "[BT] [2020-07-07 14:45:00] [INFO] [order] [NEW ORDER SUCCESS] [2020-07-07 14:45:00] [b5c5a86c76fb4f7f845ac7d9087501ae] [SELL] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 329.3] [PRICE:329.3] [TRIGGER PRICE:None] [ORDER_TYPE_BRACKET] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_ENTER] [STOPLOSS TRIGGER:332.593] [TARGET TRIGGER:326.007] [TRAILING STOPLOSS TRIGGER:329.3] [STATUS:COMPLETE]\n",
      "[BT] [2020-07-07 14:45:00] [INFO] [tls] Instrument entered position: NSE_EQ:TATASTEEL. Order placed\n",
      "[BT] [2020-07-07 14:45:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-07 15:00:00)...\n",
      "[BT] [2020-07-07 15:00:00] [CRITICAL] [order] [PLACING NEW ORDER] [2020-07-07 15:00:00] [36a1bd24bcf7461584e5d28038dcb44a] [BUY] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 326.0] [PRICE:326.0] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_EXIT]\n",
      "[BT] [2020-07-07 15:00:00] [INFO] [order] [ORDER ID RECEIVED] [ABVirtualBroker] [ID:36a1bd24bcf7461584e5d28038dcb44a] [BUY] [NSE_EQ:TATASTEEL] [Order ID: (Order: [2020-07-07 15:00:00] [36a1bd24bcf7461584e5d28038dcb44a] [BUY] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 326.0] [PRICE:326.0] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_EXIT])\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN)]\n",
      "[BT] [2020-07-07 15:00:00] [INFO] [order] [NEW ORDER SUCCESS] [2020-07-07 15:00:00] [36a1bd24bcf7461584e5d28038dcb44a] [BUY] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 326.0] [PRICE:326.0] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_EXIT] [STATUS:OPEN]\n",
      "[BT] [2020-07-07 15:00:00] [CRITICAL] [order] [PLACING NEW ORDER] [2020-07-07 15:00:00] [5ebd84229f364d92b380c531d2110bd9] [BUY] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 332.55] [PRICE:332.55] [TRIGGER PRICE:332.55] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_STOPLOSS_LIMIT] [ORDER_POSITION_EXIT]\n",
      "[BT] [2020-07-07 15:00:00] [INFO] [order] [ORDER ID RECEIVED] [ABVirtualBroker] [ID:5ebd84229f364d92b380c531d2110bd9] [BUY] [NSE_EQ:TATASTEEL] [Order ID: (Order: [2020-07-07 15:00:00] [5ebd84229f364d92b380c531d2110bd9] [BUY] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 332.55] [PRICE:332.55] [TRIGGER PRICE:332.55] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_STOPLOSS_LIMIT] [ORDER_POSITION_EXIT])\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> TRIGGER PENDING)]\n",
      "[BT] [2020-07-07 15:00:00] [INFO] [order] [NEW ORDER SUCCESS] [2020-07-07 15:00:00] [5ebd84229f364d92b380c531d2110bd9] [BUY] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 332.55] [PRICE:332.55] [TRIGGER PRICE:332.55] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_STOPLOSS_LIMIT] [ORDER_POSITION_EXIT] [STATUS:TRIGGER PENDING]\n",
      "[BT] [2020-07-07 15:00:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-07 15:15:00)...\n",
      "[BT] [2020-07-07 15:15:00] [INFO] [clock] Waiting for 900.00 seconds until end of current candle (2020-07-07 15:30:00)...\n",
      "[BT] [2020-07-07 15:30:00] [INFO] [oms] Exiting OPEN POSITION (Order: [2020-07-07 14:45:00] [b5c5a86c76fb4f7f845ac7d9087501ae] [SELL] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 329.3] [PRICE:329.3] [TRIGGER PRICE:None] [ORDER_TYPE_BRACKET] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_ENTER] [STOPLOSS TRIGGER:332.593] [TARGET TRIGGER:326.007] [TRAILING STOPLOSS TRIGGER:329.3])...\n",
      "[BT] [2020-07-07 15:30:00] [INFO] [order] Exiting child orders...\n",
      "[BT] [2020-07-07 15:30:00] [INFO] [order] Cancelling order... (Order: [2020-07-07 15:00:00] [36a1bd24bcf7461584e5d28038dcb44a] [BUY] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 326.0] [PRICE:326.0] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_EXIT])\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN)\n",
      "[BT] [2020-07-07 15:30:00] [INFO] [order] Cancelling order... (Order: [2020-07-07 15:00:00] [5ebd84229f364d92b380c531d2110bd9] [BUY] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 332.55] [PRICE:332.55] [TRIGGER PRICE:332.55] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_STOPLOSS_LIMIT] [ORDER_POSITION_EXIT])\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> TRIGGER PENDING)\n",
      "[BT] [2020-07-07 15:30:00] [INFO] [order] Exiting main bracket order...\n",
      "[BT] [2020-07-07 15:30:00] [CRITICAL] [order] [PLACING NEW ORDER] [2020-07-07 15:30:00] [a614b94300cd4d8f8dbbebfca00a8065] [BUY] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 331.0] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_EXIT]\n",
      "[BT] [2020-07-07 15:30:00] [INFO] [order] [ORDER ID RECEIVED] [ABVirtualBroker] [ID:a614b94300cd4d8f8dbbebfca00a8065] [BUY] [NSE_EQ:TATASTEEL] [Order ID: (Order: [2020-07-07 15:30:00] [a614b94300cd4d8f8dbbebfca00a8065] [BUY] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 0] [ENTRY PRICE: 331.0] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_EXIT])\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> COMPLETE)]\n",
      "[BT] [2020-07-07 15:30:00] [INFO] [order] [NEW ORDER SUCCESS] [2020-07-07 15:30:00] [a614b94300cd4d8f8dbbebfca00a8065] [BUY] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 0] [ENTRY PRICE: 331.0] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_EXIT] [STATUS:COMPLETE]\n",
      "[BT] [2020-07-07 15:30:00] [INFO] [clock] Candle generation has been stopped...\n",
      "[BT] [2020-07-07 15:30:00] [INFO] [tls] Received event END OF MARKET. Stopping Trading Core Engine...\n",
      "[BT] [2020-07-07 15:30:00] [CRITICAL] [tls] [User: ALGOBULLS VIRTUAL USER] Trading session completed\n",
      "[BT] [2020-07-07 15:30:00] [INFO] [oms] \n",
      "\n",
      "PENDING ORDERS:\n",
      "\n",
      "\n",
      "COMPLETED ORDERS:\n",
      "[2020-07-01 12:30:00] [1cbefcf395c344c88a228a1b01c32ef6] [BUY] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 0] [ENTRY PRICE: 322.6] [PRICE:322.6] [TRIGGER PRICE:None] [ORDER_TYPE_BRACKET] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_ENTER] [STOPLOSS TRIGGER:319.374] [TARGET TRIGGER:325.826] [TRAILING STOPLOSS TRIGGER:322.6]\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> COMPLETE\n",
      "\n",
      "[2020-07-01 12:45:00] [fb8be91cdc8e4d4f9c5f5ab9f7bf8934] [SELL] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 325.8] [PRICE:325.8] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_EXIT]\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> CANCEL PENDING --> CANCELLED\n",
      "\n",
      "[2020-07-01 12:45:00] [972ffb502d1a4242ae9c1f5d16bdfc46] [SELL] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 319.35] [PRICE:319.35] [TRIGGER PRICE:319.35] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_STOPLOSS_LIMIT] [ORDER_POSITION_EXIT]\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> TRIGGER PENDING --> CANCEL PENDING --> CANCELLED\n",
      "\n",
      "[2020-07-01 15:30:00] [c0d024b6a3be41f6a22efc826a8729aa] [SELL] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 0] [ENTRY PRICE: 324.1] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_EXIT]\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> COMPLETE\n",
      "\n",
      "[2020-07-03 09:45:00] [ea5a4c6c63524f39a53de71f269ee256] [SELL] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 0] [ENTRY PRICE: 330.8] [PRICE:330.8] [TRIGGER PRICE:None] [ORDER_TYPE_BRACKET] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_ENTER] [STOPLOSS TRIGGER:334.108] [TARGET TRIGGER:327.492] [TRAILING STOPLOSS TRIGGER:330.8]\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> COMPLETE\n",
      "\n",
      "[2020-07-03 10:00:00] [03436b72ad8a47a8b29bb727876b0b95] [BUY] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 0] [ENTRY PRICE: 334.1] [PRICE:334.1] [TRIGGER PRICE:334.1] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_STOPLOSS_LIMIT] [ORDER_POSITION_EXIT]\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> TRIGGER PENDING --> OPEN --> COMPLETE\n",
      "\n",
      "[2020-07-03 10:00:00] [62458cf47d5f4a12b6c31c490451fdb0] [BUY] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 327.45] [PRICE:327.45] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_EXIT]\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> CANCEL PENDING --> CANCELLED\n",
      "\n",
      "[2020-07-03 12:30:00] [a88484f7888f496e801515ff400f69ea] [BUY] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 0] [ENTRY PRICE: 334.45] [PRICE:334.45] [TRIGGER PRICE:None] [ORDER_TYPE_BRACKET] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_ENTER] [STOPLOSS TRIGGER:331.1055] [TARGET TRIGGER:337.79449999999997] [TRAILING STOPLOSS TRIGGER:334.45]\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> COMPLETE\n",
      "\n",
      "[2020-07-03 12:45:00] [f3c96875a80f41acb4c344febbc6cb43] [SELL] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 337.75] [PRICE:337.75] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_EXIT]\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> CANCEL PENDING --> CANCELLED\n",
      "\n",
      "[2020-07-03 12:45:00] [9a7b474106e549f084bb94dfe7686588] [SELL] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 331.1] [PRICE:331.1] [TRIGGER PRICE:331.1] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_STOPLOSS_LIMIT] [ORDER_POSITION_EXIT]\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> TRIGGER PENDING --> CANCEL PENDING --> CANCELLED\n",
      "\n",
      "[2020-07-03 12:45:00] [1dab5ff3edb046918fe45d43f189341e] [SELL] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 0] [ENTRY PRICE: 333.5] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_EXIT]\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> COMPLETE\n",
      "\n",
      "[2020-07-03 12:45:00] [32948c0159da4481891bd29daec2ff0a] [SELL] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 0] [ENTRY PRICE: 333.5] [PRICE:333.5] [TRIGGER PRICE:None] [ORDER_TYPE_BRACKET] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_ENTER] [STOPLOSS TRIGGER:336.835] [TARGET TRIGGER:330.165] [TRAILING STOPLOSS TRIGGER:333.5]\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> COMPLETE\n",
      "\n",
      "[2020-07-03 13:00:00] [6f1fdd54207f499aae0d71ba41a94891] [BUY] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 0] [ENTRY PRICE: 330.15] [PRICE:330.15] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_EXIT]\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> COMPLETE\n",
      "\n",
      "[2020-07-03 13:00:00] [446a3850abf145288dff03854fa20ec3] [BUY] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 336.8] [PRICE:336.8] [TRIGGER PRICE:336.8] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_STOPLOSS_LIMIT] [ORDER_POSITION_EXIT]\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> TRIGGER PENDING --> CANCEL PENDING --> CANCELLED\n",
      "\n",
      "[2020-07-06 09:45:00] [0f4ae537fdf643f2901eeb4aa3bc4a0f] [BUY] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 0] [ENTRY PRICE: 332.35] [PRICE:332.35] [TRIGGER PRICE:None] [ORDER_TYPE_BRACKET] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_ENTER] [STOPLOSS TRIGGER:329.0265] [TARGET TRIGGER:335.67350000000005] [TRAILING STOPLOSS TRIGGER:332.35]\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> COMPLETE\n",
      "\n",
      "[2020-07-06 10:00:00] [5acd4ba4137243978efd9aec9054c329] [SELL] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 0] [ENTRY PRICE: 335.65] [PRICE:335.65] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_EXIT]\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> COMPLETE\n",
      "\n",
      "[2020-07-06 10:00:00] [8e03fe4428954257af26ee042debd62e] [SELL] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 329.0] [PRICE:329.0] [TRIGGER PRICE:329.0] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_STOPLOSS_LIMIT] [ORDER_POSITION_EXIT]\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> TRIGGER PENDING --> CANCEL PENDING --> CANCELLED\n",
      "\n",
      "[2020-07-06 13:30:00] [b0400fc8e77941f8b72ace6bc3d53bca] [SELL] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 0] [ENTRY PRICE: 339.65] [PRICE:339.65] [TRIGGER PRICE:None] [ORDER_TYPE_BRACKET] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_ENTER] [STOPLOSS TRIGGER:343.0465] [TARGET TRIGGER:336.2535] [TRAILING STOPLOSS TRIGGER:339.65]\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> COMPLETE\n",
      "\n",
      "[2020-07-06 13:45:00] [7d8525013a694cdd81be74755037d7c0] [BUY] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 336.25] [PRICE:336.25] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_EXIT]\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> CANCEL PENDING --> CANCELLED\n",
      "\n",
      "[2020-07-06 13:45:00] [984310d2323541c8a5d0b5303ab40bad] [BUY] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 343.0] [PRICE:343.0] [TRIGGER PRICE:343.0] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_STOPLOSS_LIMIT] [ORDER_POSITION_EXIT]\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> TRIGGER PENDING --> CANCEL PENDING --> CANCELLED\n",
      "\n",
      "[2020-07-06 15:30:00] [f1c18daa21904a4abe92dc4d56574719] [BUY] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 0] [ENTRY PRICE: 338.85] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_EXIT]\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> COMPLETE\n",
      "\n",
      "[2020-07-07 13:15:00] [311caaf7d5564030be54069c0998a7e4] [BUY] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 0] [ENTRY PRICE: 332.6] [PRICE:332.6] [TRIGGER PRICE:None] [ORDER_TYPE_BRACKET] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_ENTER] [STOPLOSS TRIGGER:329.274] [TARGET TRIGGER:335.92600000000004] [TRAILING STOPLOSS TRIGGER:332.6]\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> COMPLETE\n",
      "\n",
      "[2020-07-07 13:30:00] [e228d5c2165048eebc28db14e428c200] [SELL] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 0] [ENTRY PRICE: 329.25] [PRICE:329.25] [TRIGGER PRICE:329.25] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_STOPLOSS_LIMIT] [ORDER_POSITION_EXIT]\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> TRIGGER PENDING --> OPEN --> COMPLETE\n",
      "\n",
      "[2020-07-07 13:30:00] [1d2d37f3a4004907a44948eb74bf5e6d] [SELL] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 335.9] [PRICE:335.9] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_EXIT]\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> CANCEL PENDING --> CANCELLED\n",
      "\n",
      "[2020-07-07 14:45:00] [b5c5a86c76fb4f7f845ac7d9087501ae] [SELL] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 0] [ENTRY PRICE: 329.3] [PRICE:329.3] [TRIGGER PRICE:None] [ORDER_TYPE_BRACKET] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_ENTER] [STOPLOSS TRIGGER:332.593] [TARGET TRIGGER:326.007] [TRAILING STOPLOSS TRIGGER:329.3]\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> COMPLETE\n",
      "\n",
      "[2020-07-07 15:00:00] [36a1bd24bcf7461584e5d28038dcb44a] [BUY] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 326.0] [PRICE:326.0] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_LIMIT] [ORDER_POSITION_EXIT]\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> CANCEL PENDING --> CANCELLED\n",
      "\n",
      "[2020-07-07 15:00:00] [5ebd84229f364d92b380c531d2110bd9] [BUY] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 1] [ENTRY PRICE: 332.55] [PRICE:332.55] [TRIGGER PRICE:332.55] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_STOPLOSS_LIMIT] [ORDER_POSITION_EXIT]\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> TRIGGER PENDING --> CANCEL PENDING --> CANCELLED\n",
      "\n",
      "[2020-07-07 15:30:00] [a614b94300cd4d8f8dbbebfca00a8065] [BUY] [NSE:TATASTEEL] [QTY:1] [QTY PENDING: 0] [ENTRY PRICE: 331.0] [PRICE:None] [TRIGGER PRICE:None] [ORDER_TYPE_REGULAR] [ORDER_CODE_INTRADAY] [ORDER_VARIETY_MARKET] [ORDER_POSITION_EXIT]\n",
      "Status History: PUT ORDER REQ RECEIVED --> VALIDATION PENDING --> OPEN PENDING --> OPEN --> COMPLETE\n",
      "\n",
      "\n",
      "POSITIONS:\n",
      "\n",
      "\n",
      "HOLDINGS:\n",
      "\n"
     ]
    }
   ],
   "source": [
    "logs = algobulls_connection.get_backtesting_logs(strategy_code2)\n",
    "print(logs)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Recipe 10: MACD-Bracket-Order Strategy: Fetching Backtesting Reports - Profit-n-Loss Table"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>instrument</th>\n",
       "      <th>entry_timestamp</th>\n",
       "      <th>entry_transaction_type</th>\n",
       "      <th>entry_quantity</th>\n",
       "      <th>entry_price</th>\n",
       "      <th>exit_timestamp</th>\n",
       "      <th>exit_transaction_type</th>\n",
       "      <th>exit_quantity</th>\n",
       "      <th>exit_price</th>\n",
       "      <th>pnl_absolute</th>\n",
       "      <th>pnl_percentage</th>\n",
       "      <th>pnl_cumulative_absolute</th>\n",
       "      <th>pnl_cumulative_percentage</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>NSE_EQ:TATASTEEL</td>\n",
       "      <td>2020-07-07 14:45:00</td>\n",
       "      <td>SELL</td>\n",
       "      <td>1</td>\n",
       "      <td>329.3</td>\n",
       "      <td>2020-07-07 15:30:00</td>\n",
       "      <td>BUY</td>\n",
       "      <td>1</td>\n",
       "      <td>331.0</td>\n",
       "      <td>-1.7</td>\n",
       "      <td>-0.52</td>\n",
       "      <td>-0.35</td>\n",
       "      <td>-0.12</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>NSE_EQ:TATASTEEL</td>\n",
       "      <td>2020-07-07 13:15:00</td>\n",
       "      <td>BUY</td>\n",
       "      <td>1</td>\n",
       "      <td>332.6</td>\n",
       "      <td>2020-07-07 13:30:00</td>\n",
       "      <td>SELL</td>\n",
       "      <td>1</td>\n",
       "      <td>329.25</td>\n",
       "      <td>-3.35</td>\n",
       "      <td>-1.01</td>\n",
       "      <td>1.35</td>\n",
       "      <td>0.4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>NSE_EQ:TATASTEEL</td>\n",
       "      <td>2020-07-06 13:30:00</td>\n",
       "      <td>SELL</td>\n",
       "      <td>1</td>\n",
       "      <td>339.65</td>\n",
       "      <td>2020-07-06 15:30:00</td>\n",
       "      <td>BUY</td>\n",
       "      <td>1</td>\n",
       "      <td>338.85</td>\n",
       "      <td>0.8</td>\n",
       "      <td>0.24</td>\n",
       "      <td>4.7</td>\n",
       "      <td>1.41</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>NSE_EQ:TATASTEEL</td>\n",
       "      <td>2020-07-06 09:45:00</td>\n",
       "      <td>BUY</td>\n",
       "      <td>1</td>\n",
       "      <td>332.35</td>\n",
       "      <td>2020-07-06 10:00:00</td>\n",
       "      <td>SELL</td>\n",
       "      <td>1</td>\n",
       "      <td>335.65</td>\n",
       "      <td>3.3</td>\n",
       "      <td>0.99</td>\n",
       "      <td>3.9</td>\n",
       "      <td>1.17</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>NSE_EQ:TATASTEEL</td>\n",
       "      <td>2020-07-03 12:45:00</td>\n",
       "      <td>SELL</td>\n",
       "      <td>1</td>\n",
       "      <td>333.5</td>\n",
       "      <td>2020-07-03 13:00:00</td>\n",
       "      <td>BUY</td>\n",
       "      <td>1</td>\n",
       "      <td>330.15</td>\n",
       "      <td>3.35</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.6</td>\n",
       "      <td>0.18</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>NSE_EQ:TATASTEEL</td>\n",
       "      <td>2020-07-03 12:30:00</td>\n",
       "      <td>BUY</td>\n",
       "      <td>1</td>\n",
       "      <td>334.45</td>\n",
       "      <td>2020-07-03 12:45:00</td>\n",
       "      <td>SELL</td>\n",
       "      <td>1</td>\n",
       "      <td>333.5</td>\n",
       "      <td>-0.95</td>\n",
       "      <td>-0.28</td>\n",
       "      <td>-2.75</td>\n",
       "      <td>-0.82</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>NSE_EQ:TATASTEEL</td>\n",
       "      <td>2020-07-03 09:45:00</td>\n",
       "      <td>SELL</td>\n",
       "      <td>1</td>\n",
       "      <td>330.8</td>\n",
       "      <td>2020-07-03 10:00:00</td>\n",
       "      <td>BUY</td>\n",
       "      <td>1</td>\n",
       "      <td>334.1</td>\n",
       "      <td>-3.3</td>\n",
       "      <td>-1.0</td>\n",
       "      <td>-1.8</td>\n",
       "      <td>-0.54</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>NSE_EQ:TATASTEEL</td>\n",
       "      <td>2020-07-01 12:30:00</td>\n",
       "      <td>BUY</td>\n",
       "      <td>1</td>\n",
       "      <td>322.6</td>\n",
       "      <td>2020-07-01 15:30:00</td>\n",
       "      <td>SELL</td>\n",
       "      <td>1</td>\n",
       "      <td>324.1</td>\n",
       "      <td>1.5</td>\n",
       "      <td>0.46</td>\n",
       "      <td>1.5</td>\n",
       "      <td>0.46</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "         instrument      entry_timestamp entry_transaction_type  \\\n",
       "0  NSE_EQ:TATASTEEL  2020-07-07 14:45:00                   SELL   \n",
       "1  NSE_EQ:TATASTEEL  2020-07-07 13:15:00                    BUY   \n",
       "2  NSE_EQ:TATASTEEL  2020-07-06 13:30:00                   SELL   \n",
       "3  NSE_EQ:TATASTEEL  2020-07-06 09:45:00                    BUY   \n",
       "4  NSE_EQ:TATASTEEL  2020-07-03 12:45:00                   SELL   \n",
       "5  NSE_EQ:TATASTEEL  2020-07-03 12:30:00                    BUY   \n",
       "6  NSE_EQ:TATASTEEL  2020-07-03 09:45:00                   SELL   \n",
       "7  NSE_EQ:TATASTEEL  2020-07-01 12:30:00                    BUY   \n",
       "\n",
       "  entry_quantity entry_price       exit_timestamp exit_transaction_type  \\\n",
       "0              1       329.3  2020-07-07 15:30:00                   BUY   \n",
       "1              1       332.6  2020-07-07 13:30:00                  SELL   \n",
       "2              1      339.65  2020-07-06 15:30:00                   BUY   \n",
       "3              1      332.35  2020-07-06 10:00:00                  SELL   \n",
       "4              1       333.5  2020-07-03 13:00:00                   BUY   \n",
       "5              1      334.45  2020-07-03 12:45:00                  SELL   \n",
       "6              1       330.8  2020-07-03 10:00:00                   BUY   \n",
       "7              1       322.6  2020-07-01 15:30:00                  SELL   \n",
       "\n",
       "  exit_quantity exit_price pnl_absolute pnl_percentage  \\\n",
       "0             1      331.0         -1.7          -0.52   \n",
       "1             1     329.25        -3.35          -1.01   \n",
       "2             1     338.85          0.8           0.24   \n",
       "3             1     335.65          3.3           0.99   \n",
       "4             1     330.15         3.35            1.0   \n",
       "5             1      333.5        -0.95          -0.28   \n",
       "6             1      334.1         -3.3           -1.0   \n",
       "7             1      324.1          1.5           0.46   \n",
       "\n",
       "  pnl_cumulative_absolute pnl_cumulative_percentage  \n",
       "0                   -0.35                     -0.12  \n",
       "1                    1.35                       0.4  \n",
       "2                     4.7                      1.41  \n",
       "3                     3.9                      1.17  \n",
       "4                     0.6                      0.18  \n",
       "5                   -2.75                     -0.82  \n",
       "6                    -1.8                     -0.54  \n",
       "7                     1.5                      0.46  "
      ]
     },
     "execution_count": 40,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "algobulls_connection.get_backtesting_report_pnl_table(strategy_code2)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Recipe 11: MACD-Bracket-Order Strategy: Fetching Backtesting Reports - Statistics Table"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>highlight_type</th>\n",
       "      <th>highlight_value</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Net PnL</td>\n",
       "      <td>-0.35</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Net PnL %</td>\n",
       "      <td>-0.12</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Max Drawdown</td>\n",
       "      <td>-2.75</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Max Drawdown %</td>\n",
       "      <td>-0.82</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Number of Trades</td>\n",
       "      <td>8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>Number of Wins</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>Number of Looses</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>Number of Long Trades</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>Number of Short Trades</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>Max Gain</td>\n",
       "      <td>3.35</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>Min Gain</td>\n",
       "      <td>-3.35</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>Avg. Profit per winning trade</td>\n",
       "      <td>2.24</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>Avg. Profit per losing trade</td>\n",
       "      <td>-2.32</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                   highlight_type highlight_value\n",
       "0                         Net PnL           -0.35\n",
       "1                       Net PnL %           -0.12\n",
       "2                    Max Drawdown           -2.75\n",
       "3                  Max Drawdown %           -0.82\n",
       "4                Number of Trades               8\n",
       "5                  Number of Wins               4\n",
       "6                Number of Looses               4\n",
       "7           Number of Long Trades               4\n",
       "8          Number of Short Trades               4\n",
       "9                        Max Gain            3.35\n",
       "10                       Min Gain           -3.35\n",
       "11  Avg. Profit per winning trade            2.24\n",
       "12   Avg. Profit per losing trade           -2.32"
      ]
     },
     "execution_count": 41,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "algobulls_connection.get_backtesting_report_statistics(strategy_code2)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Recipe 12: MACD-Bracket-Order Strategy: Fetching Backtesting Reports - Order History"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\n",
      "+------------------+---------------------+----------------------------------+------+\n",
      "| INST             | TIME                | ID                               | TT   |\n",
      "|------------------+---------------------+----------------------------------+------|\n",
      "| NSE_EQ:TATASTEEL | 2020-07-01 12:30:00 | 1cbefcf395c344c88a228a1b01c32ef6 | BUY  |\n",
      "+------------------+---------------------+----------------------------------+------+\n",
      "+----+---------------------+------------------------+-------+\n",
      "|    | TIME                | STATE                  | MSG   |\n",
      "|----+---------------------+------------------------+-------|\n",
      "|  0 | 2020-07-01 12:30:00 | PUT ORDER REQ RECEIVED |       |\n",
      "|  1 | 2020-07-01 12:30:00 | VALIDATION PENDING     |       |\n",
      "|  2 | 2020-07-01 12:30:00 | OPEN PENDING           |       |\n",
      "|  3 | 2020-07-01 12:30:00 | OPEN                   |       |\n",
      "|  4 | 2020-07-01 12:30:00 | COMPLETE               |       |\n",
      "+----+---------------------+------------------------+-------+\n",
      "\n",
      "+------------------+---------------------+----------------------------------+------+\n",
      "| INST             | TIME                | ID                               | TT   |\n",
      "|------------------+---------------------+----------------------------------+------|\n",
      "| NSE_EQ:TATASTEEL | 2020-07-01 12:45:00 | fb8be91cdc8e4d4f9c5f5ab9f7bf8934 | SELL |\n",
      "+------------------+---------------------+----------------------------------+------+\n",
      "+----+---------------------+------------------------+-------+\n",
      "|    | TIME                | STATE                  | MSG   |\n",
      "|----+---------------------+------------------------+-------|\n",
      "|  0 | 2020-07-01 12:45:00 | PUT ORDER REQ RECEIVED |       |\n",
      "|  1 | 2020-07-01 12:45:00 | VALIDATION PENDING     |       |\n",
      "|  2 | 2020-07-01 12:45:00 | OPEN PENDING           |       |\n",
      "|  3 | 2020-07-01 12:45:00 | OPEN                   |       |\n",
      "|  4 | 2020-07-01 15:30:00 | CANCEL PENDING         |       |\n",
      "|  5 | 2020-07-01 15:30:00 | CANCELLED              |       |\n",
      "+----+---------------------+------------------------+-------+\n",
      "\n",
      "+------------------+---------------------+----------------------------------+------+\n",
      "| INST             | TIME                | ID                               | TT   |\n",
      "|------------------+---------------------+----------------------------------+------|\n",
      "| NSE_EQ:TATASTEEL | 2020-07-01 12:45:00 | 972ffb502d1a4242ae9c1f5d16bdfc46 | SELL |\n",
      "+------------------+---------------------+----------------------------------+------+\n",
      "+----+---------------------+------------------------+-------+\n",
      "|    | TIME                | STATE                  | MSG   |\n",
      "|----+---------------------+------------------------+-------|\n",
      "|  0 | 2020-07-01 12:45:00 | PUT ORDER REQ RECEIVED |       |\n",
      "|  1 | 2020-07-01 12:45:00 | VALIDATION PENDING     |       |\n",
      "|  2 | 2020-07-01 12:45:00 | OPEN PENDING           |       |\n",
      "|  3 | 2020-07-01 12:45:00 | TRIGGER PENDING        |       |\n",
      "|  4 | 2020-07-01 15:30:00 | CANCEL PENDING         |       |\n",
      "|  5 | 2020-07-01 15:30:00 | CANCELLED              |       |\n",
      "+----+---------------------+------------------------+-------+\n",
      "\n",
      "+------------------+---------------------+----------------------------------+------+\n",
      "| INST             | TIME                | ID                               | TT   |\n",
      "|------------------+---------------------+----------------------------------+------|\n",
      "| NSE_EQ:TATASTEEL | 2020-07-01 15:30:00 | c0d024b6a3be41f6a22efc826a8729aa | SELL |\n",
      "+------------------+---------------------+----------------------------------+------+\n",
      "+----+---------------------+------------------------+-------+\n",
      "|    | TIME                | STATE                  | MSG   |\n",
      "|----+---------------------+------------------------+-------|\n",
      "|  0 | 2020-07-01 15:30:00 | PUT ORDER REQ RECEIVED |       |\n",
      "|  1 | 2020-07-01 15:30:00 | VALIDATION PENDING     |       |\n",
      "|  2 | 2020-07-01 15:30:00 | OPEN PENDING           |       |\n",
      "|  3 | 2020-07-01 15:30:00 | OPEN                   |       |\n",
      "|  4 | 2020-07-01 15:30:00 | COMPLETE               |       |\n",
      "+----+---------------------+------------------------+-------+\n",
      "\n",
      "+------------------+---------------------+----------------------------------+------+\n",
      "| INST             | TIME                | ID                               | TT   |\n",
      "|------------------+---------------------+----------------------------------+------|\n",
      "| NSE_EQ:TATASTEEL | 2020-07-03 09:45:00 | ea5a4c6c63524f39a53de71f269ee256 | SELL |\n",
      "+------------------+---------------------+----------------------------------+------+\n",
      "+----+---------------------+------------------------+-------+\n",
      "|    | TIME                | STATE                  | MSG   |\n",
      "|----+---------------------+------------------------+-------|\n",
      "|  0 | 2020-07-03 09:45:00 | PUT ORDER REQ RECEIVED |       |\n",
      "|  1 | 2020-07-03 09:45:00 | VALIDATION PENDING     |       |\n",
      "|  2 | 2020-07-03 09:45:00 | OPEN PENDING           |       |\n",
      "|  3 | 2020-07-03 09:45:00 | OPEN                   |       |\n",
      "|  4 | 2020-07-03 09:45:00 | COMPLETE               |       |\n",
      "+----+---------------------+------------------------+-------+\n",
      "\n",
      "+------------------+---------------------+----------------------------------+------+\n",
      "| INST             | TIME                | ID                               | TT   |\n",
      "|------------------+---------------------+----------------------------------+------|\n",
      "| NSE_EQ:TATASTEEL | 2020-07-03 10:00:00 | 03436b72ad8a47a8b29bb727876b0b95 | BUY  |\n",
      "+------------------+---------------------+----------------------------------+------+\n",
      "+----+---------------------+------------------------+-------+\n",
      "|    | TIME                | STATE                  | MSG   |\n",
      "|----+---------------------+------------------------+-------|\n",
      "|  0 | 2020-07-03 10:00:00 | PUT ORDER REQ RECEIVED |       |\n",
      "|  1 | 2020-07-03 10:00:00 | VALIDATION PENDING     |       |\n",
      "|  2 | 2020-07-03 10:00:00 | OPEN PENDING           |       |\n",
      "|  3 | 2020-07-03 10:00:00 | TRIGGER PENDING        |       |\n",
      "|  4 | 2020-07-03 12:30:00 | OPEN                   |       |\n",
      "|  5 | 2020-07-03 12:30:00 | COMPLETE               |       |\n",
      "+----+---------------------+------------------------+-------+\n",
      "\n",
      "+------------------+---------------------+----------------------------------+------+\n",
      "| INST             | TIME                | ID                               | TT   |\n",
      "|------------------+---------------------+----------------------------------+------|\n",
      "| NSE_EQ:TATASTEEL | 2020-07-03 10:00:00 | 62458cf47d5f4a12b6c31c490451fdb0 | BUY  |\n",
      "+------------------+---------------------+----------------------------------+------+\n",
      "+----+---------------------+------------------------+-------+\n",
      "|    | TIME                | STATE                  | MSG   |\n",
      "|----+---------------------+------------------------+-------|\n",
      "|  0 | 2020-07-03 10:00:00 | PUT ORDER REQ RECEIVED |       |\n",
      "|  1 | 2020-07-03 10:00:00 | VALIDATION PENDING     |       |\n",
      "|  2 | 2020-07-03 10:00:00 | OPEN PENDING           |       |\n",
      "|  3 | 2020-07-03 10:00:00 | OPEN                   |       |\n",
      "|  4 | 2020-07-03 12:30:00 | CANCEL PENDING         |       |\n",
      "|  5 | 2020-07-03 12:30:00 | CANCELLED              |       |\n",
      "+----+---------------------+------------------------+-------+\n",
      "\n",
      "+------------------+---------------------+----------------------------------+------+\n",
      "| INST             | TIME                | ID                               | TT   |\n",
      "|------------------+---------------------+----------------------------------+------|\n",
      "| NSE_EQ:TATASTEEL | 2020-07-03 12:30:00 | a88484f7888f496e801515ff400f69ea | BUY  |\n",
      "+------------------+---------------------+----------------------------------+------+\n",
      "+----+---------------------+------------------------+-------+\n",
      "|    | TIME                | STATE                  | MSG   |\n",
      "|----+---------------------+------------------------+-------|\n",
      "|  0 | 2020-07-03 12:30:00 | PUT ORDER REQ RECEIVED |       |\n",
      "|  1 | 2020-07-03 12:30:00 | VALIDATION PENDING     |       |\n",
      "|  2 | 2020-07-03 12:30:00 | OPEN PENDING           |       |\n",
      "|  3 | 2020-07-03 12:30:00 | OPEN                   |       |\n",
      "|  4 | 2020-07-03 12:30:00 | COMPLETE               |       |\n",
      "+----+---------------------+------------------------+-------+\n",
      "\n",
      "+------------------+---------------------+----------------------------------+------+\n",
      "| INST             | TIME                | ID                               | TT   |\n",
      "|------------------+---------------------+----------------------------------+------|\n",
      "| NSE_EQ:TATASTEEL | 2020-07-03 12:45:00 | f3c96875a80f41acb4c344febbc6cb43 | SELL |\n",
      "+------------------+---------------------+----------------------------------+------+\n",
      "+----+---------------------+------------------------+-------+\n",
      "|    | TIME                | STATE                  | MSG   |\n",
      "|----+---------------------+------------------------+-------|\n",
      "|  0 | 2020-07-03 12:45:00 | PUT ORDER REQ RECEIVED |       |\n",
      "|  1 | 2020-07-03 12:45:00 | VALIDATION PENDING     |       |\n",
      "|  2 | 2020-07-03 12:45:00 | OPEN PENDING           |       |\n",
      "|  3 | 2020-07-03 12:45:00 | OPEN                   |       |\n",
      "|  4 | 2020-07-03 12:45:00 | CANCEL PENDING         |       |\n",
      "|  5 | 2020-07-03 12:45:00 | CANCELLED              |       |\n",
      "+----+---------------------+------------------------+-------+\n",
      "\n",
      "+------------------+---------------------+----------------------------------+------+\n",
      "| INST             | TIME                | ID                               | TT   |\n",
      "|------------------+---------------------+----------------------------------+------|\n",
      "| NSE_EQ:TATASTEEL | 2020-07-03 12:45:00 | 9a7b474106e549f084bb94dfe7686588 | SELL |\n",
      "+------------------+---------------------+----------------------------------+------+\n",
      "+----+---------------------+------------------------+-------+\n",
      "|    | TIME                | STATE                  | MSG   |\n",
      "|----+---------------------+------------------------+-------|\n",
      "|  0 | 2020-07-03 12:45:00 | PUT ORDER REQ RECEIVED |       |\n",
      "|  1 | 2020-07-03 12:45:00 | VALIDATION PENDING     |       |\n",
      "|  2 | 2020-07-03 12:45:00 | OPEN PENDING           |       |\n",
      "|  3 | 2020-07-03 12:45:00 | TRIGGER PENDING        |       |\n",
      "|  4 | 2020-07-03 12:45:00 | CANCEL PENDING         |       |\n",
      "|  5 | 2020-07-03 12:45:00 | CANCELLED              |       |\n",
      "+----+---------------------+------------------------+-------+\n",
      "\n",
      "+------------------+---------------------+----------------------------------+------+\n",
      "| INST             | TIME                | ID                               | TT   |\n",
      "|------------------+---------------------+----------------------------------+------|\n",
      "| NSE_EQ:TATASTEEL | 2020-07-03 12:45:00 | 1dab5ff3edb046918fe45d43f189341e | SELL |\n",
      "+------------------+---------------------+----------------------------------+------+\n",
      "+----+---------------------+------------------------+-------+\n",
      "|    | TIME                | STATE                  | MSG   |\n",
      "|----+---------------------+------------------------+-------|\n",
      "|  0 | 2020-07-03 12:45:00 | PUT ORDER REQ RECEIVED |       |\n",
      "|  1 | 2020-07-03 12:45:00 | VALIDATION PENDING     |       |\n",
      "|  2 | 2020-07-03 12:45:00 | OPEN PENDING           |       |\n",
      "|  3 | 2020-07-03 12:45:00 | OPEN                   |       |\n",
      "|  4 | 2020-07-03 12:45:00 | COMPLETE               |       |\n",
      "+----+---------------------+------------------------+-------+\n",
      "\n",
      "+------------------+---------------------+----------------------------------+------+\n",
      "| INST             | TIME                | ID                               | TT   |\n",
      "|------------------+---------------------+----------------------------------+------|\n",
      "| NSE_EQ:TATASTEEL | 2020-07-03 12:45:00 | 32948c0159da4481891bd29daec2ff0a | SELL |\n",
      "+------------------+---------------------+----------------------------------+------+\n",
      "+----+---------------------+------------------------+-------+\n",
      "|    | TIME                | STATE                  | MSG   |\n",
      "|----+---------------------+------------------------+-------|\n",
      "|  0 | 2020-07-03 12:45:00 | PUT ORDER REQ RECEIVED |       |\n",
      "|  1 | 2020-07-03 12:45:00 | VALIDATION PENDING     |       |\n",
      "|  2 | 2020-07-03 12:45:00 | OPEN PENDING           |       |\n",
      "|  3 | 2020-07-03 12:45:00 | OPEN                   |       |\n",
      "|  4 | 2020-07-03 12:45:00 | COMPLETE               |       |\n",
      "+----+---------------------+------------------------+-------+\n",
      "\n",
      "+------------------+---------------------+----------------------------------+------+\n",
      "| INST             | TIME                | ID                               | TT   |\n",
      "|------------------+---------------------+----------------------------------+------|\n",
      "| NSE_EQ:TATASTEEL | 2020-07-03 13:00:00 | 6f1fdd54207f499aae0d71ba41a94891 | BUY  |\n",
      "+------------------+---------------------+----------------------------------+------+\n",
      "+----+---------------------+------------------------+-------+\n",
      "|    | TIME                | STATE                  | MSG   |\n",
      "|----+---------------------+------------------------+-------|\n",
      "|  0 | 2020-07-03 13:00:00 | PUT ORDER REQ RECEIVED |       |\n",
      "|  1 | 2020-07-03 13:00:00 | VALIDATION PENDING     |       |\n",
      "|  2 | 2020-07-03 13:00:00 | OPEN PENDING           |       |\n",
      "|  3 | 2020-07-03 13:00:00 | OPEN                   |       |\n",
      "|  4 | 2020-07-03 14:45:00 | COMPLETE               |       |\n",
      "+----+---------------------+------------------------+-------+\n",
      "\n",
      "+------------------+---------------------+----------------------------------+------+\n",
      "| INST             | TIME                | ID                               | TT   |\n",
      "|------------------+---------------------+----------------------------------+------|\n",
      "| NSE_EQ:TATASTEEL | 2020-07-03 13:00:00 | 446a3850abf145288dff03854fa20ec3 | BUY  |\n",
      "+------------------+---------------------+----------------------------------+------+\n",
      "+----+---------------------+------------------------+-------+\n",
      "|    | TIME                | STATE                  | MSG   |\n",
      "|----+---------------------+------------------------+-------|\n",
      "|  0 | 2020-07-03 13:00:00 | PUT ORDER REQ RECEIVED |       |\n",
      "|  1 | 2020-07-03 13:00:00 | VALIDATION PENDING     |       |\n",
      "|  2 | 2020-07-03 13:00:00 | OPEN PENDING           |       |\n",
      "|  3 | 2020-07-03 13:00:00 | TRIGGER PENDING        |       |\n",
      "|  4 | 2020-07-03 14:45:00 | CANCEL PENDING         |       |\n",
      "|  5 | 2020-07-03 14:45:00 | CANCELLED              |       |\n",
      "+----+---------------------+------------------------+-------+\n",
      "\n",
      "+------------------+---------------------+----------------------------------+------+\n",
      "| INST             | TIME                | ID                               | TT   |\n",
      "|------------------+---------------------+----------------------------------+------|\n",
      "| NSE_EQ:TATASTEEL | 2020-07-06 09:45:00 | 0f4ae537fdf643f2901eeb4aa3bc4a0f | BUY  |\n",
      "+------------------+---------------------+----------------------------------+------+\n",
      "+----+---------------------+------------------------+-------+\n",
      "|    | TIME                | STATE                  | MSG   |\n",
      "|----+---------------------+------------------------+-------|\n",
      "|  0 | 2020-07-06 09:45:00 | PUT ORDER REQ RECEIVED |       |\n",
      "|  1 | 2020-07-06 09:45:00 | VALIDATION PENDING     |       |\n",
      "|  2 | 2020-07-06 09:45:00 | OPEN PENDING           |       |\n",
      "|  3 | 2020-07-06 09:45:00 | OPEN                   |       |\n",
      "|  4 | 2020-07-06 09:45:00 | COMPLETE               |       |\n",
      "+----+---------------------+------------------------+-------+\n",
      "\n",
      "+------------------+---------------------+----------------------------------+------+\n",
      "| INST             | TIME                | ID                               | TT   |\n",
      "|------------------+---------------------+----------------------------------+------|\n",
      "| NSE_EQ:TATASTEEL | 2020-07-06 10:00:00 | 5acd4ba4137243978efd9aec9054c329 | SELL |\n",
      "+------------------+---------------------+----------------------------------+------+\n",
      "+----+---------------------+------------------------+-------+\n",
      "|    | TIME                | STATE                  | MSG   |\n",
      "|----+---------------------+------------------------+-------|\n",
      "|  0 | 2020-07-06 10:00:00 | PUT ORDER REQ RECEIVED |       |\n",
      "|  1 | 2020-07-06 10:00:00 | VALIDATION PENDING     |       |\n",
      "|  2 | 2020-07-06 10:00:00 | OPEN PENDING           |       |\n",
      "|  3 | 2020-07-06 10:00:00 | OPEN                   |       |\n",
      "|  4 | 2020-07-06 10:15:00 | COMPLETE               |       |\n",
      "+----+---------------------+------------------------+-------+\n",
      "\n",
      "+------------------+---------------------+----------------------------------+------+\n",
      "| INST             | TIME                | ID                               | TT   |\n",
      "|------------------+---------------------+----------------------------------+------|\n",
      "| NSE_EQ:TATASTEEL | 2020-07-06 10:00:00 | 8e03fe4428954257af26ee042debd62e | SELL |\n",
      "+------------------+---------------------+----------------------------------+------+\n",
      "+----+---------------------+------------------------+-------+\n",
      "|    | TIME                | STATE                  | MSG   |\n",
      "|----+---------------------+------------------------+-------|\n",
      "|  0 | 2020-07-06 10:00:00 | PUT ORDER REQ RECEIVED |       |\n",
      "|  1 | 2020-07-06 10:00:00 | VALIDATION PENDING     |       |\n",
      "|  2 | 2020-07-06 10:00:00 | OPEN PENDING           |       |\n",
      "|  3 | 2020-07-06 10:00:00 | TRIGGER PENDING        |       |\n",
      "|  4 | 2020-07-06 10:15:00 | CANCEL PENDING         |       |\n",
      "|  5 | 2020-07-06 10:15:00 | CANCELLED              |       |\n",
      "+----+---------------------+------------------------+-------+\n",
      "\n",
      "+------------------+---------------------+----------------------------------+------+\n",
      "| INST             | TIME                | ID                               | TT   |\n",
      "|------------------+---------------------+----------------------------------+------|\n",
      "| NSE_EQ:TATASTEEL | 2020-07-06 13:30:00 | b0400fc8e77941f8b72ace6bc3d53bca | SELL |\n",
      "+------------------+---------------------+----------------------------------+------+\n",
      "+----+---------------------+------------------------+-------+\n",
      "|    | TIME                | STATE                  | MSG   |\n",
      "|----+---------------------+------------------------+-------|\n",
      "|  0 | 2020-07-06 13:30:00 | PUT ORDER REQ RECEIVED |       |\n",
      "|  1 | 2020-07-06 13:30:00 | VALIDATION PENDING     |       |\n",
      "|  2 | 2020-07-06 13:30:00 | OPEN PENDING           |       |\n",
      "|  3 | 2020-07-06 13:30:00 | OPEN                   |       |\n",
      "|  4 | 2020-07-06 13:30:00 | COMPLETE               |       |\n",
      "+----+---------------------+------------------------+-------+\n",
      "\n",
      "+------------------+---------------------+----------------------------------+------+\n",
      "| INST             | TIME                | ID                               | TT   |\n",
      "|------------------+---------------------+----------------------------------+------|\n",
      "| NSE_EQ:TATASTEEL | 2020-07-06 13:45:00 | 7d8525013a694cdd81be74755037d7c0 | BUY  |\n",
      "+------------------+---------------------+----------------------------------+------+\n",
      "+----+---------------------+------------------------+-------+\n",
      "|    | TIME                | STATE                  | MSG   |\n",
      "|----+---------------------+------------------------+-------|\n",
      "|  0 | 2020-07-06 13:45:00 | PUT ORDER REQ RECEIVED |       |\n",
      "|  1 | 2020-07-06 13:45:00 | VALIDATION PENDING     |       |\n",
      "|  2 | 2020-07-06 13:45:00 | OPEN PENDING           |       |\n",
      "|  3 | 2020-07-06 13:45:00 | OPEN                   |       |\n",
      "|  4 | 2020-07-06 15:30:00 | CANCEL PENDING         |       |\n",
      "|  5 | 2020-07-06 15:30:00 | CANCELLED              |       |\n",
      "+----+---------------------+------------------------+-------+\n",
      "\n",
      "+------------------+---------------------+----------------------------------+------+\n",
      "| INST             | TIME                | ID                               | TT   |\n",
      "|------------------+---------------------+----------------------------------+------|\n",
      "| NSE_EQ:TATASTEEL | 2020-07-06 13:45:00 | 984310d2323541c8a5d0b5303ab40bad | BUY  |\n",
      "+------------------+---------------------+----------------------------------+------+\n",
      "+----+---------------------+------------------------+-------+\n",
      "|    | TIME                | STATE                  | MSG   |\n",
      "|----+---------------------+------------------------+-------|\n",
      "|  0 | 2020-07-06 13:45:00 | PUT ORDER REQ RECEIVED |       |\n",
      "|  1 | 2020-07-06 13:45:00 | VALIDATION PENDING     |       |\n",
      "|  2 | 2020-07-06 13:45:00 | OPEN PENDING           |       |\n",
      "|  3 | 2020-07-06 13:45:00 | TRIGGER PENDING        |       |\n",
      "|  4 | 2020-07-06 15:30:00 | CANCEL PENDING         |       |\n",
      "|  5 | 2020-07-06 15:30:00 | CANCELLED              |       |\n",
      "+----+---------------------+------------------------+-------+\n",
      "\n",
      "+------------------+---------------------+----------------------------------+------+\n",
      "| INST             | TIME                | ID                               | TT   |\n",
      "|------------------+---------------------+----------------------------------+------|\n",
      "| NSE_EQ:TATASTEEL | 2020-07-06 15:30:00 | f1c18daa21904a4abe92dc4d56574719 | BUY  |\n",
      "+------------------+---------------------+----------------------------------+------+\n",
      "+----+---------------------+------------------------+-------+\n",
      "|    | TIME                | STATE                  | MSG   |\n",
      "|----+---------------------+------------------------+-------|\n",
      "|  0 | 2020-07-06 15:30:00 | PUT ORDER REQ RECEIVED |       |\n",
      "|  1 | 2020-07-06 15:30:00 | VALIDATION PENDING     |       |\n",
      "|  2 | 2020-07-06 15:30:00 | OPEN PENDING           |       |\n",
      "|  3 | 2020-07-06 15:30:00 | OPEN                   |       |\n",
      "|  4 | 2020-07-06 15:30:00 | COMPLETE               |       |\n",
      "+----+---------------------+------------------------+-------+\n",
      "\n",
      "+------------------+---------------------+----------------------------------+------+\n",
      "| INST             | TIME                | ID                               | TT   |\n",
      "|------------------+---------------------+----------------------------------+------|\n",
      "| NSE_EQ:TATASTEEL | 2020-07-07 13:15:00 | 311caaf7d5564030be54069c0998a7e4 | BUY  |\n",
      "+------------------+---------------------+----------------------------------+------+\n",
      "+----+---------------------+------------------------+-------+\n",
      "|    | TIME                | STATE                  | MSG   |\n",
      "|----+---------------------+------------------------+-------|\n",
      "|  0 | 2020-07-07 13:15:00 | PUT ORDER REQ RECEIVED |       |\n",
      "|  1 | 2020-07-07 13:15:00 | VALIDATION PENDING     |       |\n",
      "|  2 | 2020-07-07 13:15:00 | OPEN PENDING           |       |\n",
      "|  3 | 2020-07-07 13:15:00 | OPEN                   |       |\n",
      "|  4 | 2020-07-07 13:15:00 | COMPLETE               |       |\n",
      "+----+---------------------+------------------------+-------+\n",
      "\n",
      "+------------------+---------------------+----------------------------------+------+\n",
      "| INST             | TIME                | ID                               | TT   |\n",
      "|------------------+---------------------+----------------------------------+------|\n",
      "| NSE_EQ:TATASTEEL | 2020-07-07 13:30:00 | e228d5c2165048eebc28db14e428c200 | SELL |\n",
      "+------------------+---------------------+----------------------------------+------+\n",
      "+----+---------------------+------------------------+-------+\n",
      "|    | TIME                | STATE                  | MSG   |\n",
      "|----+---------------------+------------------------+-------|\n",
      "|  0 | 2020-07-07 13:30:00 | PUT ORDER REQ RECEIVED |       |\n",
      "|  1 | 2020-07-07 13:30:00 | VALIDATION PENDING     |       |\n",
      "|  2 | 2020-07-07 13:30:00 | OPEN PENDING           |       |\n",
      "|  3 | 2020-07-07 13:30:00 | TRIGGER PENDING        |       |\n",
      "|  4 | 2020-07-07 14:45:00 | OPEN                   |       |\n",
      "|  5 | 2020-07-07 14:45:00 | COMPLETE               |       |\n",
      "+----+---------------------+------------------------+-------+\n",
      "\n",
      "+------------------+---------------------+----------------------------------+------+\n",
      "| INST             | TIME                | ID                               | TT   |\n",
      "|------------------+---------------------+----------------------------------+------|\n",
      "| NSE_EQ:TATASTEEL | 2020-07-07 13:30:00 | 1d2d37f3a4004907a44948eb74bf5e6d | SELL |\n",
      "+------------------+---------------------+----------------------------------+------+\n",
      "+----+---------------------+------------------------+-------+\n",
      "|    | TIME                | STATE                  | MSG   |\n",
      "|----+---------------------+------------------------+-------|\n",
      "|  0 | 2020-07-07 13:30:00 | PUT ORDER REQ RECEIVED |       |\n",
      "|  1 | 2020-07-07 13:30:00 | VALIDATION PENDING     |       |\n",
      "|  2 | 2020-07-07 13:30:00 | OPEN PENDING           |       |\n",
      "|  3 | 2020-07-07 13:30:00 | OPEN                   |       |\n",
      "|  4 | 2020-07-07 14:45:00 | CANCEL PENDING         |       |\n",
      "|  5 | 2020-07-07 14:45:00 | CANCELLED              |       |\n",
      "+----+---------------------+------------------------+-------+\n",
      "\n",
      "+------------------+---------------------+----------------------------------+------+\n",
      "| INST             | TIME                | ID                               | TT   |\n",
      "|------------------+---------------------+----------------------------------+------|\n",
      "| NSE_EQ:TATASTEEL | 2020-07-07 14:45:00 | b5c5a86c76fb4f7f845ac7d9087501ae | SELL |\n",
      "+------------------+---------------------+----------------------------------+------+\n",
      "+----+---------------------+------------------------+-------+\n",
      "|    | TIME                | STATE                  | MSG   |\n",
      "|----+---------------------+------------------------+-------|\n",
      "|  0 | 2020-07-07 14:45:00 | PUT ORDER REQ RECEIVED |       |\n",
      "|  1 | 2020-07-07 14:45:00 | VALIDATION PENDING     |       |\n",
      "|  2 | 2020-07-07 14:45:00 | OPEN PENDING           |       |\n",
      "|  3 | 2020-07-07 14:45:00 | OPEN                   |       |\n",
      "|  4 | 2020-07-07 14:45:00 | COMPLETE               |       |\n",
      "+----+---------------------+------------------------+-------+\n",
      "\n",
      "+------------------+---------------------+----------------------------------+------+\n",
      "| INST             | TIME                | ID                               | TT   |\n",
      "|------------------+---------------------+----------------------------------+------|\n",
      "| NSE_EQ:TATASTEEL | 2020-07-07 15:00:00 | 36a1bd24bcf7461584e5d28038dcb44a | BUY  |\n",
      "+------------------+---------------------+----------------------------------+------+\n",
      "+----+---------------------+------------------------+-------+\n",
      "|    | TIME                | STATE                  | MSG   |\n",
      "|----+---------------------+------------------------+-------|\n",
      "|  0 | 2020-07-07 15:00:00 | PUT ORDER REQ RECEIVED |       |\n",
      "|  1 | 2020-07-07 15:00:00 | VALIDATION PENDING     |       |\n",
      "|  2 | 2020-07-07 15:00:00 | OPEN PENDING           |       |\n",
      "|  3 | 2020-07-07 15:00:00 | OPEN                   |       |\n",
      "|  4 | 2020-07-07 15:30:00 | CANCEL PENDING         |       |\n",
      "|  5 | 2020-07-07 15:30:00 | CANCELLED              |       |\n",
      "+----+---------------------+------------------------+-------+\n",
      "\n",
      "+------------------+---------------------+----------------------------------+------+\n",
      "| INST             | TIME                | ID                               | TT   |\n",
      "|------------------+---------------------+----------------------------------+------|\n",
      "| NSE_EQ:TATASTEEL | 2020-07-07 15:00:00 | 5ebd84229f364d92b380c531d2110bd9 | BUY  |\n",
      "+------------------+---------------------+----------------------------------+------+\n",
      "+----+---------------------+------------------------+-------+\n",
      "|    | TIME                | STATE                  | MSG   |\n",
      "|----+---------------------+------------------------+-------|\n",
      "|  0 | 2020-07-07 15:00:00 | PUT ORDER REQ RECEIVED |       |\n",
      "|  1 | 2020-07-07 15:00:00 | VALIDATION PENDING     |       |\n",
      "|  2 | 2020-07-07 15:00:00 | OPEN PENDING           |       |\n",
      "|  3 | 2020-07-07 15:00:00 | TRIGGER PENDING        |       |\n",
      "|  4 | 2020-07-07 15:30:00 | CANCEL PENDING         |       |\n",
      "|  5 | 2020-07-07 15:30:00 | CANCELLED              |       |\n",
      "+----+---------------------+------------------------+-------+\n",
      "\n",
      "+------------------+---------------------+----------------------------------+------+\n",
      "| INST             | TIME                | ID                               | TT   |\n",
      "|------------------+---------------------+----------------------------------+------|\n",
      "| NSE_EQ:TATASTEEL | 2020-07-07 15:30:00 | a614b94300cd4d8f8dbbebfca00a8065 | BUY  |\n",
      "+------------------+---------------------+----------------------------------+------+\n",
      "+----+---------------------+------------------------+-------+\n",
      "|    | TIME                | STATE                  | MSG   |\n",
      "|----+---------------------+------------------------+-------|\n",
      "|  0 | 2020-07-07 15:30:00 | PUT ORDER REQ RECEIVED |       |\n",
      "|  1 | 2020-07-07 15:30:00 | VALIDATION PENDING     |       |\n",
      "|  2 | 2020-07-07 15:30:00 | OPEN PENDING           |       |\n",
      "|  3 | 2020-07-07 15:30:00 | OPEN                   |       |\n",
      "|  4 | 2020-07-07 15:30:00 | COMPLETE               |       |\n",
      "+----+---------------------+------------------------+-------+\n"
     ]
    }
   ],
   "source": [
    "order_history = algobulls_connection.get_backtesting_report_order_history(strategy_code2)\n",
    "print(order_history)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
